diff --git a/bones_loot/depends.txt b/bones_loot/depends.txt deleted file mode 100644 index ef795e4..0000000 --- a/bones_loot/depends.txt +++ /dev/null @@ -1,3 +0,0 @@ -bones -dungeon_loot? -intllib? \ No newline at end of file diff --git a/bones_loot/init.lua b/bones_loot/init.lua index 4f7d08b..b1fb70e 100644 --- a/bones_loot/init.lua +++ b/bones_loot/init.lua @@ -106,6 +106,17 @@ bones_loot.get_loot = function(pos, loot_type, max_stacks, exclusive_loot_type) return items end +local bones_formspec = + "size[8,9]" .. + "list[current_name;main;0,0.3;8,4;]" .. + "list[current_player;main;0,4.85;8,1;]" .. + "list[current_player;main;0,6.08;8,3;8]" .. + "listring[current_name;main]" .. + "listring[current_player;main]" +if minetest.get_modpath("default") then + bones_formspec = bones_formspec .. default.get_hotbar_bg(0,4.85) +end + bones_loot.place_bones = function(pos, loot_type, max_stacks, infotext, exclusive_loot_type) minetest.set_node(pos, {name="bones:bones", param2 = math.random(1,4)-1}) local meta = minetest.get_meta(pos) @@ -113,6 +124,7 @@ bones_loot.place_bones = function(pos, loot_type, max_stacks, infotext, exclusiv infotext = S("Someone's old bones") end meta:set_string("infotext", infotext) + meta:set_string("formspec", bones_formspec) if max_stacks and max_stacks > 0 then local loot = bones_loot.get_loot(pos, loot_type, max_stacks, exclusive_loot_type) @@ -123,3 +135,15 @@ bones_loot.place_bones = function(pos, loot_type, max_stacks, infotext, exclusiv end end end + +minetest.register_lbm({ + label = "Repair underworld bones formspec", + name = "bones_loot:repair_underworld_bones_formspec", + nodenames = {"bones:bones"}, + action = function(pos, node) + local meta = minetest.get_meta(pos) + if not meta:get("formspec") then + meta:set_string("formspec", bones_formspec) + end + end, +}) diff --git a/bones_loot/mod.conf b/bones_loot/mod.conf index a5497d0..bca991c 100644 --- a/bones_loot/mod.conf +++ b/bones_loot/mod.conf @@ -1,4 +1,4 @@ name = bones_loot description = An API that allows bones to be placed procedurally with randomly generated loot depends = bones -optional_depends = dungeon_loot, intllib \ No newline at end of file +optional_depends = dungeon_loot, intllib, default \ No newline at end of file diff --git a/df_caverns/config.lua b/df_caverns/config.lua index d92d9a1..0794480 100644 --- a/df_caverns/config.lua +++ b/df_caverns/config.lua @@ -7,11 +7,11 @@ local print_settingtypes = false local function setting(stype, name, default, description) local value if stype == "bool" then - value = minetest.setting_getbool(CONFIG_FILE_PREFIX..name) + value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name, default) elseif stype == "string" then - value = minetest.setting_get(CONFIG_FILE_PREFIX..name) + value = minetest.settings:get(CONFIG_FILE_PREFIX..name) elseif stype == "int" or stype == "float" then - value = tonumber(minetest.setting_get(CONFIG_FILE_PREFIX..name)) + value = tonumber(minetest.settings:get(CONFIG_FILE_PREFIX..name)) end if value == nil then value = default @@ -48,3 +48,7 @@ setting("bool", "enable_underworld", true, "Enable underworld") df_caverns.config.enable_underworld = df_caverns.config.enable_underworld and minetest.get_modpath("df_underworld_items") ~= nil setting("int", "underworld_level", -3200, "Underworld level") setting("int", "underworld_glowing_pit_mapblocks", 8, "Average pit spacing measured in mapblocks") + +setting("bool", "enable_primordial", true, "Enable primordial cavern") +setting("int", "primordial_max", -3393, "Upper limit to primordial caverns") +setting("int", "primordial_min", -4032, "Lower limit to primordial caverns") diff --git a/df_caverns/depends.txt b/df_caverns/depends.txt deleted file mode 100644 index 575eaae..0000000 --- a/df_caverns/depends.txt +++ /dev/null @@ -1,10 +0,0 @@ -default -subterrane -df_farming? -df_trees -df_mapitems -ice_sprites? -oil? -df_underworld_items? -magma_conduits? -bones_loot? \ No newline at end of file diff --git a/df_caverns/description.txt b/df_caverns/description.txt deleted file mode 100644 index 2af064c..0000000 --- a/df_caverns/description.txt +++ /dev/null @@ -1 +0,0 @@ -Adds vast underground caverns in the style of Dwarf Fortress, complete with underground flora in diverse biomes. Also adds stalactite/stalagmite decorations in the smaller tunnels. \ No newline at end of file diff --git a/df_caverns/dungeon_loot.lua b/df_caverns/dungeon_loot.lua index b919ddd..1dcbcdc 100644 --- a/df_caverns/dungeon_loot.lua +++ b/df_caverns/dungeon_loot.lua @@ -49,8 +49,14 @@ bones_loot.register_loot({ {name = "binoculars:binoculars", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, {name = "boats:boat", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, {name = "bucket:bucket_empty", chance = 0.3, count = {1,1}, types = {"underworld_warrior"}}, - {name = "fire:flint_and_steel", chance = 0.3, count = {1,2}, types = {"underworld_warrior"}}, - {name = "flowers:tulip_black", chance = 0.01, count = {1,1}, types = {"underworld_warrior"}}, + {name = "fire:flint_and_steel", chance = 0.3, count = {1,1}, types = {"underworld_warrior"}}, + {name = "flowers:tulip_black", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, + {name = "flowers:dandelion_white", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, + {name = "flowers:dandelion_yellow", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, + {name = "flowers:rose", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, + {name = "flowers:tulip", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, + {name = "flowers:chrysanthemum_green", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, + {name = "flowers:geranium", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, {name = "map:mapping_kit", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}}, {name = "screwdriver:screwdriver", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, -- don't give the player tnt:tnt, they can craft that from this if tnt is enabled for them @@ -70,10 +76,10 @@ bones_loot.register_loot({ {name = "default:pick_steel", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}}, {name = "default:pick_mese", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, {name = "default:pick_diamond", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, - {name = "default:shovel_bronze", chance = 0.15, count = {1,1}, types = {"underworld_warrior"}}, - {name = "default:shovel_steel", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}}, - {name = "default:shovel_mese", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, - {name = "default:shovel_diamond", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, + {name = "default:shovel_bronze", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}}, + {name = "default:shovel_steel", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}}, + {name = "default:shovel_mese", chance = 0.025, count = {1,1}, types = {"underworld_warrior"}}, + {name = "default:shovel_diamond", chance = 0.025, count = {1,1}, types = {"underworld_warrior"}}, {name = "default:axe_bronze", chance = 0.3, count = {1,1}, types = {"underworld_warrior"}}, {name = "default:axe_steel", chance = 0.5, count = {1,1}, types = {"underworld_warrior"}}, {name = "default:axe_mese", chance = 0.15, count = {1,1}, types = {"underworld_warrior"}}, diff --git a/df_caverns/init.lua b/df_caverns/init.lua index 06b68d7..a284149 100644 --- a/df_caverns/init.lua +++ b/df_caverns/init.lua @@ -15,4 +15,5 @@ dofile(modpath.."/sunless_sea.lua") dofile(modpath.."/oil_sea.lua") dofile(modpath.."/lava_sea.lua") dofile(modpath.."/underworld.lua") -dofile(modpath.."/dungeon_loot.lua") \ No newline at end of file +dofile(modpath.."/primordial.lua") +dofile(modpath.."/dungeon_loot.lua") diff --git a/df_caverns/lava_sea.lua b/df_caverns/lava_sea.lua index 0266497..57515b6 100644 --- a/df_caverns/lava_sea.lua +++ b/df_caverns/lava_sea.lua @@ -137,11 +137,6 @@ minetest.register_on_generated(function(minp, maxp, seed) --write it to world vm:write_to_map() - local chunk_generation_time = math.ceil((os.clock() - t_start) * 1000) --grab how long it took - if chunk_generation_time < 1000 then - minetest.log("info", "[df_caverns] lava sea mapblock generation took "..chunk_generation_time.." ms") --tell people how long - else - minetest.log("warning", "[df_caverns] lava sea took "..chunk_generation_time.." ms to generate map block " - .. minetest.pos_to_string(minp) .. minetest.pos_to_string(maxp)) - end + local time_taken = os.clock() - t_start -- how long this chunk took, in seconds + mapgen_helper.record_time("df_caverns lava sea", time_taken) end) \ No newline at end of file diff --git a/df_caverns/level1.lua b/df_caverns/level1.lua index 8623b04..c6b2138 100644 --- a/df_caverns/level1.lua +++ b/df_caverns/level1.lua @@ -96,8 +96,9 @@ local decorate_level_1 = function(minp, maxp, seed, vm, node_arrays, area, data) -- Partly fill flooded caverns and warrens if minp.y <= subsea_level then - for vi in area:iterp(minp, maxp) do - if data[vi] == c_air and area:get_y(vi) <= subsea_level and nvals_cave[cave_area:transform(area, vi)] < -flooding_threshold then + for vi, x, y, z in area:iterp_yxz(area.MinEdge, area.MaxEdge) do + -- convert all air below sea level into water + if y <= subsea_level and data[vi] == c_air and nvals_cave[vi] < -flooding_threshold then data[vi] = c_water end end @@ -111,7 +112,7 @@ local decorate_level_1 = function(minp, maxp, seed, vm, node_arrays, area, data) local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) local abs_cracks = math.abs(nvals_cracks[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if minp.y < subsea_level and area:get_y(vi) < subsea_level and flooded_caverns then -- underwater floor @@ -137,7 +138,7 @@ local decorate_level_1 = function(minp, maxp, seed, vm, node_arrays, area, data) local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) local abs_cracks = math.abs(nvals_cracks[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level then -- underwater ceiling, do nothing @@ -164,7 +165,7 @@ local decorate_level_1 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.tunnel_floor_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then if flooded_caverns or biome_name ~= "barren" then @@ -182,7 +183,7 @@ local decorate_level_1 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.tunnel_ceiling_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then if flooded_caverns or biome_name ~= "barren" then @@ -210,7 +211,7 @@ local decorate_level_1 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.warren_floor_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. local ystride = area.ystride if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then @@ -249,7 +250,7 @@ local decorate_level_1 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.warren_ceiling_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then if flooded_caverns or biome_name ~= "barren" then @@ -268,7 +269,7 @@ local decorate_level_1 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.column_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local dry = (biome_name == "barren") and (nvals_cave[cave_area:transform(area, vi)] > 0) + local dry = (biome_name == "barren") and (nvals_cave[vi] > 0) if dry and data[vi] == c_wet_flowstone then data[vi] = c_dry_flowstone @@ -300,4 +301,5 @@ subterrane.register_layer({ decorate = decorate_level_1, warren_region_variability_threshold = 0.33, double_frequency = true, + is_ground_content = df_caverns.is_ground_content, }) \ No newline at end of file diff --git a/df_caverns/level2.lua b/df_caverns/level2.lua index 6ae6497..2fd412b 100644 --- a/df_caverns/level2.lua +++ b/df_caverns/level2.lua @@ -79,7 +79,7 @@ local goblin_cap_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, 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 - df_trees.spawn_goblin_cap_vm(vi+ystride, area, data) + df_trees.spawn_goblin_cap_vm(vi+ystride, area, data, data_param2) end end @@ -98,7 +98,7 @@ local spore_tree_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, if math.random() < 0.1 then df_caverns.place_shrub(vi+ystride, area, data, data_param2, spore_tree_shrublist) elseif math.random() < 0.05 then - df_trees.spawn_spore_tree_vm(vi+ystride, area, data) + df_trees.spawn_spore_tree_vm(vi+ystride, area, data, data_param2) end end end @@ -135,28 +135,29 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data) local cavern_def = node_arrays.cavern_def local vein_noise + local vein_area -- Partly fill flooded caverns and warrens - for vi in area:iterp(minp, maxp) do - local cave_val = nvals_cave[cave_area:transform(area, vi)] + for vi, x, y, z in area:iterp_yxz(area.MinEdge, area.MaxEdge) do + local cave_val = nvals_cave[vi] if cave_val < -flooding_threshold then - - local index2d = mapgen_helper.index2di(minp, maxp, area, vi) - local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local cave_threshold = cavern_def.cave_threshold + if mapgen_helper.is_pos_within_box({x=x, y=y, z=z}, minp, maxp) then + local index2d = mapgen_helper.index2di(minp, maxp, area, vi) + local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) + local cave_threshold = cavern_def.cave_threshold - --check if we're just inside the boundary of the (negazone) cavern threshold - if biome_name == "barren" and cave_val < -cave_threshold and cave_val > -cave_threshold - 0.01 then - -- add giant rooty structures to the flooded barren caverns - if vein_noise == nil then - vein_noise = mapgen_helper.perlin3d("df_caverns:wall_veins", minp, maxp, wall_vein_perlin_params) - end - -- we can reuse cave_area here, its extents are minp, maxp too. - if data[vi] == c_air and math.abs(vein_noise[cave_area:transform(area, vi)]) < 0.02 then - data[vi] = c_veinstone + --check if we're just inside the boundary of the (negazone) cavern threshold + if biome_name == "barren" and cave_val < -cave_threshold and cave_val > -cave_threshold - 0.01 then + -- add giant rooty structures to the flooded barren caverns + if vein_noise == nil then + vein_noise, vein_area = mapgen_helper.perlin3d("df_caverns:wall_veins", minp, maxp, wall_vein_perlin_params) + end + if data[vi] == c_air and math.abs(vein_noise[vein_area:transform(area, vi)]) < 0.02 then + data[vi] = c_veinstone + end end end - if data[vi] == c_air and area:get_y(vi) <= subsea_level then + if data[vi] == c_air and y <= subsea_level then data[vi] = c_water -- otherwise, fill air with water when below sea level end end @@ -170,7 +171,7 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data) local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) local abs_cracks = math.abs(nvals_cracks[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if minp.y < subsea_level and area:get_y(vi) < subsea_level and flooded_caverns then -- underwater floor @@ -198,7 +199,7 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data) local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) local abs_cracks = math.abs(nvals_cracks[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level then -- underwater ceiling, do nothing @@ -230,7 +231,7 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.tunnel_floor_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then if flooded_caverns or biome_name ~= "barren" then @@ -248,7 +249,7 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.tunnel_ceiling_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. local ystride = area.ystride if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then @@ -287,7 +288,7 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.warren_floor_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then if flooded_caverns or biome_name ~= "barren" then @@ -305,7 +306,7 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.warren_ceiling_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. local ystride = area.ystride if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then @@ -345,7 +346,7 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.column_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local dry = (biome_name == "barren") and (nvals_cave[cave_area:transform(area, vi)] > 0) + local dry = (biome_name == "barren") and (nvals_cave[vi] > 0) if dry and data[vi] == c_wet_flowstone then data[vi] = c_dry_flowstone @@ -375,5 +376,6 @@ subterrane.register_layer({ decorate = decorate_level_2, warren_region_variability_threshold = 0.33, double_frequency = true, + is_ground_content = df_caverns.is_ground_content, }) diff --git a/df_caverns/level3.lua b/df_caverns/level3.lua index e402d3b..6b9986e 100644 --- a/df_caverns/level3.lua +++ b/df_caverns/level3.lua @@ -28,7 +28,7 @@ if minetest.get_modpath("ice_sprites") then c_sprite = minetest.get_content_id("ice_sprites:ice_sprite") end -local subsea_level = df_caverns.config.level3_min - (df_caverns.config.level3_min - df_caverns.config.level2_min) * 0.33 +local subsea_level = math.floor(df_caverns.config.level3_min - (df_caverns.config.level3_min - df_caverns.config.level2_min) * 0.33) local flooding_threshold = math.min(df_caverns.config.tunnel_flooding_threshold, df_caverns.config.cavern_threshold) local ice_thickness = 3 @@ -165,7 +165,7 @@ local blood_thorn_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, if abs_cracks < 0.075 then if vert_rand < 0.004 then subterrane.big_stalagmite(ai, area, data, 6, 15, c_dry_flowstone, c_dry_flowstone, c_dry_flowstone) - elseif data[vi] ~= air and math.random() < 0.5 then + elseif data[vi] ~= c_air and math.random() < 0.5 then data[vi] = c_salty_cobble if data[ai] == c_air and math.random() < 0.25 then data[ai] = c_salt_crystal @@ -207,25 +207,25 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) -- Partly fill flooded caverns and warrens if minp.y <= subsea_level then - for vi in area:iterp(minp, maxp) do - local y = area:get_y(vi) - if y <= subsea_level and nvals_cave[cave_area:transform(area, vi)] < -flooding_threshold then + for vi, x, y, z in area:iterp_yxz(area.MinEdge, area.MaxEdge) do + local cave = nvals_cave[vi] + if y <= subsea_level and cave < -flooding_threshold then if data[vi] == c_air and y <= subsea_level then data[vi] = c_water end - local index2d = mapgen_helper.index2di(minp, maxp, area, vi) - local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - - if biome_name == "blackcap" then - -- oil slick - local cave = math.abs(nvals_cave[cave_area:transform(area, vi)]) - if y == subsea_level and data[vi] == c_water and cave + nvals_cracks[index2d]*0.025 < cavern_def.cave_threshold + 0.1 then - data[vi] = c_oil + if (mapgen_helper.is_pos_within_box({x=x, y=y, z=z}, minp, maxp)) then + local index2d = mapgen_helper.index2di(minp, maxp, area, vi) + local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) + if biome_name == "blackcap" then + -- oil slick + if y == subsea_level and data[vi] == c_water and math.abs(cave) + nvals_cracks[index2d]*0.025 < cavern_def.cave_threshold + 0.1 then + data[vi] = c_oil + end + elseif biome_name == "bloodnether" and y <= subsea_level and y > subsea_level - ice_thickness and data[vi] == c_water then + -- floating ice + data[vi] = c_ice end - elseif biome_name == "bloodnether" and y <= subsea_level and y > subsea_level - ice_thickness and data[vi] == c_water then - -- floating ice - data[vi] = c_ice end end end @@ -240,7 +240,7 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) local cracks = nvals_cracks[index2d] local abs_cracks = math.abs(cracks) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level then -- underwater floor @@ -285,7 +285,7 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) local abs_cracks = math.abs(nvals_cracks[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level then -- underwater ceiling, do nothing @@ -321,7 +321,7 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) else -- bloodthorn ceiling if abs_cracks < 0.075 then - if data[vi] ~= air and math.random() < 0.5 then + if data[vi] ~= c_air and math.random() < 0.5 then data[vi] = c_salty_cobble local bi = vi - area.ystride if data[bi] == c_air and math.random() < 0.25 then @@ -346,7 +346,7 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.tunnel_floor_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then if flooded_caverns or biome_name == "blackcap" then @@ -364,7 +364,7 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.tunnel_ceiling_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then if flooded_caverns or biome_name == "blackcap" then @@ -393,7 +393,7 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.warren_ceiling_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level then -- underwater ceiling, do nothing @@ -431,7 +431,7 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.warren_floor_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not. + local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. if minp.y < subsea_level and area:get_y(vi) < subsea_level and flooded_caverns then -- underwater floor, do nothing @@ -473,7 +473,7 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) for _, vi in ipairs(node_arrays.column_nodes) do local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) - local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 + local flooded_caverns = nvals_cave[vi] < 0 if biome_name == "bloodnether" and data[vi] == c_wet_flowstone then if not flooded_caverns then @@ -527,4 +527,5 @@ subterrane.register_layer({ decorate = decorate_level_3, warren_region_variability_threshold = 0.33, double_frequency = true, + is_ground_content = df_caverns.is_ground_content, }) diff --git a/df_caverns/locale/template.pot b/df_caverns/locale/template.pot new file mode 100644 index 0000000..805c3ee --- /dev/null +++ b/df_caverns/locale/template.pot @@ -0,0 +1,26 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-01-25 13:52-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: df_caverns\underworld.lua:12 +msgid "A glowing pit" +msgstr "" + +#: df_caverns\underworld.lua:27 +msgid "A mysterious seal" +msgstr "" diff --git a/df_caverns/locale/update.bat b/df_caverns/locale/update.bat new file mode 100644 index 0000000..48b25ab --- /dev/null +++ b/df_caverns/locale/update.bat @@ -0,0 +1,6 @@ +@echo off +setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION +cd .. +set LIST= +for /r %%X in (*.lua) do set LIST=!LIST! %%X +..\..\intllib\tools\xgettext.bat %LIST% \ No newline at end of file diff --git a/df_caverns/mod.conf b/df_caverns/mod.conf index 40b0992..f51da08 100644 --- a/df_caverns/mod.conf +++ b/df_caverns/mod.conf @@ -1,4 +1,4 @@ name = df_caverns description = Adds vast underground caverns in the style of Dwarf Fortress, complete with underground flora in diverse biomes. Also adds stalactite/stalagmite decorations in the smaller tunnels. depends = default, subterrane, df_trees, df_mapitems -optional_depends = df_farming, ice_sprites, oil, df_underworld_items, magma_conduits, bones_loot \ No newline at end of file +optional_depends = df_farming, ice_sprites, oil, df_underworld_items, magma_conduits, bones_loot, named_waypoints, namegen, fireflies \ No newline at end of file diff --git a/df_caverns/oil_sea.lua b/df_caverns/oil_sea.lua index 4560c31..a5ed2d8 100644 --- a/df_caverns/oil_sea.lua +++ b/df_caverns/oil_sea.lua @@ -102,13 +102,8 @@ minetest.register_on_generated(function(minp, maxp, seed) --write it to world vm:write_to_map() - local chunk_generation_time = math.ceil((os.clock() - t_start) * 1000) --grab how long it took - if chunk_generation_time < 1000 then - minetest.log("info", "[df_caverns] oil sea mapblock generation took "..chunk_generation_time.." ms") --tell people how long - else - minetest.log("warning", "[df_caverns] oil sea took "..chunk_generation_time.." ms to generate map block " - .. minetest.pos_to_string(minp) .. minetest.pos_to_string(maxp)) - end + local time_taken = os.clock() - t_start -- how long this chunk took, in seconds + mapgen_helper.record_time("df_caverns oil sea", time_taken) end) minetest.register_ore({ diff --git a/df_caverns/primordial.lua b/df_caverns/primordial.lua new file mode 100644 index 0000000..c2b46db --- /dev/null +++ b/df_caverns/primordial.lua @@ -0,0 +1,425 @@ +if not df_caverns.config.enable_primordial or not minetest.get_modpath("df_primordial_items") then + return +end + +local perlin_cave_primordial = { + offset = 0, + scale = 1, + spread = {x=df_caverns.config.horizontal_cavern_scale, y=df_caverns.config.vertical_cavern_scale*0.5, z=df_caverns.config.horizontal_cavern_scale}, + seed = 14055553, + octaves = 3, + persist = 0.67 +} + +local perlin_wave_primordial = { + offset = 0, + scale = 1, + spread = {x=df_caverns.config.horizontal_cavern_scale, y=df_caverns.config.vertical_cavern_scale*0.5, z=df_caverns.config.horizontal_cavern_scale}, + seed = 923444, + octaves = 6, + persist = 0.63 +} + +local c_air = minetest.get_content_id("air") + +local giant_mycelium_timer_spread = tonumber(minetest.settings:get("dcaverns_giant_mycelium_timer_spread")) or 10 + +----------------------------------------------------------------------------------------- +-- Fungal biome + +local c_orb = minetest.get_content_id("df_primordial_items:glow_orb_hanging") +local c_mycelial_dirt = minetest.get_content_id("df_primordial_items:dirt_with_mycelium") +local c_dirt = minetest.get_content_id("default:dirt") +local c_giant_mycelium = minetest.get_content_id("df_primordial_items:giant_hypha_apical_mapgen") + +local fungal_plants = { + minetest.get_content_id("df_primordial_items:fungal_grass_1"), + minetest.get_content_id("df_primordial_items:fungal_grass_2"), + minetest.get_content_id("df_primordial_items:glow_orb"), + minetest.get_content_id("df_primordial_items:glow_orb_stalks"), + minetest.get_content_id("df_primordial_items:glow_pods"), +} + +local fungal_plant_names = {} +local fungal_plants = {} +for node_name, node_def in pairs(minetest.registered_nodes) do + if minetest.get_item_group(node_name, "primordial_fungal_plant") > 0 then + table.insert(fungal_plant_names, node_name) + table.insert(fungal_plants, minetest.get_content_id(node_name)) + end +end + +local mushroom_cavern_floor = function(abs_cracks, humidity, vi, area, data, data_param2) + local ystride = area.ystride + local humidityfactor = humidity/200 + 0.5 + abs_cracks = abs_cracks * humidityfactor + + if abs_cracks < 0.7 then + data[vi] = c_mycelial_dirt + elseif abs_cracks < 1 then + data[vi] = c_dirt + end + + local rand = math.random() * math.min(abs_cracks, 1) * humidityfactor + if rand < 0.0005 then + local mycelium_index = vi+ystride + data[mycelium_index] = c_giant_mycelium + minetest.get_node_timer(area:position(mycelium_index)):start(math.random(1,giant_mycelium_timer_spread)) + elseif rand < 0.003 then + local schematic = df_primordial_items.get_primordial_mushroom() + local rotation = (math.random(1,4)-1)*90 + mapgen_helper.place_schematic_on_data_if_it_fits(data, data_param2, area, area:position(vi+ystride), schematic, rotation) + elseif rand < 0.05 then + data[vi+ystride] = fungal_plants[math.random(1,5)] + end +end + +local mushroom_cavern_ceiling = function(abs_cracks, humidity, vi, area, data, data_param2) + local ystride = area.ystride + local humidityfactor = humidity/200 + 0.5 + abs_cracks = abs_cracks * humidityfactor + + if abs_cracks < 0.5 then + data[vi] = c_mycelial_dirt + if abs_cracks < 0.3 then + local rand = math.random() * humidityfactor + if rand < 0.002 then + local mycelium_index = vi-ystride + data[mycelium_index] = c_giant_mycelium + minetest.get_node_timer(area:position(mycelium_index)):start(math.random(1,giant_mycelium_timer_spread)) + elseif rand < 0.03 then + df_primordial_items.spawn_ceiling_spire_vm(vi, area, data) + elseif rand < 0.2 then + data[vi-ystride] = c_orb + data_param2[vi-ystride] = math.random(0,179) + end + end + end +end + +local mushroom_warren_ceiling = function(abs_cracks, vi, area, data, data_param2) + local ystride = area.ystride + + if abs_cracks < 0.3 then + data[vi] = c_mycelial_dirt + if abs_cracks < 0.2 then + local rand = math.random() + if rand < 0.001 then + local mycelium_index = vi-ystride + data[mycelium_index] = c_giant_mycelium + minetest.get_node_timer(area:position(mycelium_index)):start(math.random(1,giant_mycelium_timer_spread)) + elseif rand < 0.2 then + data[vi-ystride] = c_orb + data_param2[vi-ystride] = math.random(0,179) + end + end + end +end + +local mushroom_warren_floor = function(abs_cracks, vi, area, data, data_param2) + local ystride = area.ystride + if abs_cracks < 0.7 then + data[vi] = c_mycelial_dirt + elseif abs_cracks < 1 then + data[vi] = c_dirt + end + local rand = math.random() * math.min(abs_cracks, 1) + if rand < 0.001 then + local mycelium_index = vi+ystride + data[mycelium_index] = c_giant_mycelium + minetest.get_node_timer(area:position(mycelium_index)):start(math.random(1,giant_mycelium_timer_spread)) + elseif rand < 0.03 then + data[vi+ystride] = fungal_plants[math.random(1,5)] + end +end + +-------------------------------------------------------------------------------------------------- +-- Jungle biome + +local jungle_plant_names = {} +local jungle_plants = {} +for node_name, node_def in pairs(minetest.registered_nodes) do + if minetest.get_item_group(node_name, "primordial_jungle_plant") > 0 then + table.insert(jungle_plant_names, node_name) + table.insert(jungle_plants, minetest.get_content_id(node_name)) + end +end + +local c_jungle_dirt = minetest.get_content_id("df_primordial_items:dirt_with_jungle_grass") +local c_plant_matter = minetest.get_content_id("df_primordial_items:plant_matter") +local c_packed_roots = minetest.get_content_id("df_primordial_items:packed_roots") +local c_glowstone = minetest.get_content_id("df_underworld_items:glowstone") +local c_ivy = minetest.get_content_id("df_primordial_items:jungle_ivy") +local c_root_2 = minetest.get_content_id("df_primordial_items:jungle_roots_2") +local c_root_1 = minetest.get_content_id("df_primordial_items:jungle_roots_1") + +local c_fireflies +if minetest.get_modpath("fireflies") then + c_fireflies = minetest.get_content_id("fireflies:firefly") +end + +local jungle_cavern_floor = function(abs_cracks, humidity, vi, area, data, data_param2) + local ystride = area.ystride + local humidityfactor = humidity/100 + + data[vi] = c_jungle_dirt + + local rand = math.random() + if rand < 0.025 * humidityfactor then + local fern_schematic = df_primordial_items.get_fern_schematic() + local rotation = (math.random(1,4)-1)*90 + mapgen_helper.place_schematic_on_data_if_it_fits(data, data_param2, area, area:position(vi+ystride), fern_schematic, rotation) + elseif rand < 0.025 * (1-humidityfactor) then + df_primordial_items.spawn_jungle_mushroom_vm(vi+ystride, area, data) + elseif rand < 0.05 * (1-humidityfactor) then + df_primordial_items.spawn_jungle_tree_vm(math.random(8,14), vi+ystride, area, data) + elseif rand < 0.3 then + data[vi+ystride] = jungle_plants[math.random(1,#jungle_plants)] + end + + if c_fireflies and math.random() < 0.01 then + local firefly_vi = vi + ystride * math.random(1, 5) + if data[firefly_vi] == c_air then + data[firefly_vi] = c_fireflies + end + end +end + +local jungle_cavern_ceiling = function(abs_cracks, vi, area, data, data_param2) + if abs_cracks < 0.25 then + data[vi] = c_glowstone + elseif abs_cracks > 0.75 and math.random() < 0.1 then + local ystride = area.ystride + data[vi] = c_dirt + local index = vi - ystride + local hanging_node + if math.random() < 0.5 then + hanging_node = c_ivy + else + hanging_node = c_root_2 + end + for i = 1, math.random(16) do + if data[index] == c_air then + data[index] = hanging_node + index = index - ystride + else + break + end + end + end +end + +local jungle_warren_ceiling = function(abs_cracks, vi, area, data, data_param2) + if abs_cracks < 0.1 then + data[vi] = c_glowstone + elseif abs_cracks > 0.75 and math.random() < 0.1 then + local ystride = area.ystride + data[vi] = c_dirt + local index = vi - ystride + local hanging_node + if math.random() < 0.5 then + hanging_node = c_root_1 + else + hanging_node = c_root_2 + end + for i = 1, math.random(8) do + if data[index] == c_air then + data[index] = hanging_node + index = index - ystride + else + break + end + end + end +end + +local jungle_warren_floor = function(abs_cracks, vi, area, data, data_param2) + local ystride = area.ystride + if abs_cracks < 0.7 then + data[vi] = c_jungle_dirt + local rand = math.random() * abs_cracks + if rand < 0.1 then + data[vi+ystride] = jungle_plants[math.random(1,#jungle_plants)] + end + elseif abs_cracks < 1 then + data[vi] = c_dirt + end + + if c_fireflies and math.random() < 0.005 then + local firefly_vi = vi + ystride * math.random(1, 5) + if data[firefly_vi] == c_air then + data[firefly_vi] = c_fireflies + end + end +end +--------------------------------------------------------------------------------------------------------- + +local decorate_primordial = function(minp, maxp, seed, vm, node_arrays, area, data) + math.randomseed(minp.x + minp.y*2^8 + minp.z*2^16 + seed) -- make decorations consistent between runs + + local data_param2 = df_caverns.data_param2 + vm:get_param2_data(data_param2) + local nvals_cracks = mapgen_helper.perlin2d("df_cavern:cracks", minp, maxp, df_caverns.np_cracks) + local cave_area = node_arrays.cave_area + local nvals_cave = node_arrays.nvals_cave + + local humiditymap = minetest.get_mapgen_object("humiditymap") + + + --------------------------------------------------------- + -- Cavern floors + + for _, vi in ipairs(node_arrays.cavern_floor_nodes) do + local index2d = mapgen_helper.index2di(minp, maxp, area, vi) + local cracks = nvals_cracks[index2d] + local abs_cracks = math.abs(cracks) + local humidity = humiditymap[index2d] + local jungle = nvals_cave[vi] < 0 + + if jungle then + jungle_cavern_floor(abs_cracks, humidity, vi, area, data, data_param2) + else + mushroom_cavern_floor(abs_cracks, humidity, vi, area, data, data_param2) + end + end + + -------------------------------------- + -- Cavern ceilings + + for _, vi in ipairs(node_arrays.cavern_ceiling_nodes) do + local index2d = mapgen_helper.index2di(minp, maxp, area, vi) + local cracks = nvals_cracks[index2d] + local abs_cracks = math.abs(cracks) + local jungle = nvals_cave[vi] < 0 + local humidity = humiditymap[index2d] + if jungle then + jungle_cavern_ceiling(abs_cracks, vi, area, data, data_param2) + else + mushroom_cavern_ceiling(abs_cracks, humidity, vi, area, data, data_param2) + end + end + + ---------------------------------------------- + -- Tunnel floors + +-- for _, vi in ipairs(node_arrays.tunnel_floor_nodes) do +-- end + + ------------------------------------------------------ + -- Tunnel ceiling + +-- for _, vi in ipairs(node_arrays.tunnel_ceiling_nodes) do +-- end + + ------------------------------------------------------ + -- Warren ceiling + + for _, vi in ipairs(node_arrays.warren_ceiling_nodes) do + local index2d = mapgen_helper.index2di(minp, maxp, area, vi) + local cracks = nvals_cracks[index2d] + local abs_cracks = math.abs(cracks) + local jungle = nvals_cave[vi] < 0 + + if jungle then + jungle_warren_ceiling(abs_cracks, vi, area, data, data_param2) + else + mushroom_warren_ceiling(abs_cracks, vi, area, data, data_param2) + end + + end + + ---------------------------------------------- + -- Warren floors + + for _, vi in ipairs(node_arrays.warren_floor_nodes) do + local index2d = mapgen_helper.index2di(minp, maxp, area, vi) + local cracks = nvals_cracks[index2d] + local abs_cracks = math.abs(cracks) + local jungle = nvals_cave[vi] < 0 + + if jungle then + jungle_warren_floor(abs_cracks, vi, area, data, data_param2) + else + mushroom_warren_floor(abs_cracks, vi, area, data, data_param2) + end + end + + -- columns + -- no flowstone below the Sunless Sea, replace with something else + local random_dir = {1, -1, area.zstride, -area.zstride} + for _, vi in ipairs(node_arrays.column_nodes) do + local jungle = nvals_cave[vi] < 0 + if jungle then + data[vi] = c_plant_matter + minetest.get_node_timer(area:position(vi)):start(math.random(30, 120)) + else + data[vi] = c_mycelial_dirt + if math.random() < 0.05 then + local rand_vi = vi + random_dir[math.random(1,4)] + if data[rand_vi] == c_air then + data[rand_vi] = c_giant_mycelium + minetest.get_node_timer(area:position(rand_vi)):start(math.random(1,giant_mycelium_timer_spread)) + end + end + end + end + + vm:set_param2_data(data_param2) +end + +--Primordial Caverns +subterrane.register_layer({ + name = "primordial", + y_max = df_caverns.config.primordial_max, + y_min = df_caverns.config.primordial_min, + cave_threshold = df_caverns.config.sunless_sea_threshold, -- Make the caves a bit bigger than above + perlin_cave = perlin_cave_primordial, + perlin_wave = perlin_wave_primordial, + solidify_lava = true, + columns = { + maximum_radius = 20, + minimum_radius = 5, + node = "default:stone", -- no flowstone below the Sunless Sea, replace with something else + weight = 0.5, + maximum_count = 60, + minimum_count = 10, + }, + decorate = decorate_primordial, + double_frequency = true, + is_ground_content = df_caverns.is_ground_content, +}) + +-- Rather than make plants farmable, have them randomly respawn in jungle soil. You can only get them down there. +minetest.register_abm({ + label = "Primordial plant growth", + nodenames = {"df_primordial_items:dirt_with_jungle_grass"}, + neighbors = {"air"}, + interval = 60.0, + chance = 50, + action = function(pos, node, active_object_count, active_object_count_wider) + if minetest.find_node_near(pos, 2, {"group:primordial_jungle_plant"}) == nil then + local pos_above = {x=pos.x, y=pos.y+1, z=pos.z} + local node_above = minetest.get_node(pos_above) + if node_above.name == "air" then + minetest.set_node(pos_above, {name = jungle_plant_names[math.random(1,#jungle_plant_names)]}) + end + end + end, +}) + +minetest.register_abm({ + label = "Primordial fungus growth", + nodenames = {"df_primordial_items:dirt_with_mycelium"}, + neighbors = {"air"}, + interval = 60.0, + chance = 50, + action = function(pos, node, active_object_count, active_object_count_wider) + if minetest.find_node_near(pos, 3, {"group:primordial_fungal_plant"}) == nil then + local pos_above = {x=pos.x, y=pos.y+1, z=pos.z} + local node_above = minetest.get_node(pos_above) + if node_above.name == "air" then + minetest.set_node(pos_above, {name = fungal_plant_names[math.random(1,#fungal_plant_names)]}) + end + end + end, +}) diff --git a/df_caverns/screenshots/magma_sea_mese.jpg b/df_caverns/screenshots/magma_sea_mese.jpg index a9463a0..be1a729 100644 Binary files a/df_caverns/screenshots/magma_sea_mese.jpg and b/df_caverns/screenshots/magma_sea_mese.jpg differ diff --git a/df_caverns/screenshots/mysterious_seal.jpg b/df_caverns/screenshots/mysterious_seal.jpg new file mode 100644 index 0000000..68bfd1d Binary files /dev/null and b/df_caverns/screenshots/mysterious_seal.jpg differ diff --git a/df_caverns/screenshots/primordial_fungal.jpg b/df_caverns/screenshots/primordial_fungal.jpg new file mode 100644 index 0000000..6f3056f Binary files /dev/null and b/df_caverns/screenshots/primordial_fungal.jpg differ diff --git a/df_caverns/screenshots/primordial_jungle.jpg b/df_caverns/screenshots/primordial_jungle.jpg new file mode 100644 index 0000000..2fb2146 Binary files /dev/null and b/df_caverns/screenshots/primordial_jungle.jpg differ diff --git a/df_caverns/screenshots/underworld.jpg b/df_caverns/screenshots/underworld.jpg index 7170985..0b42fa2 100644 Binary files a/df_caverns/screenshots/underworld.jpg and b/df_caverns/screenshots/underworld.jpg differ diff --git a/df_caverns/settingtypes.txt b/df_caverns/settingtypes.txt index a2c6878..e4e3002 100644 --- a/df_caverns/settingtypes.txt +++ b/df_caverns/settingtypes.txt @@ -37,4 +37,37 @@ dfcaverns_lava_sea_level (Lava sea level) int -2900 dfcaverns_enable_underworld (Generate underworld) bool true dfcaverns_underworld_level (Underworld level) int -3200 #Set this to 0 to disable glowing pit generation entirely. -dfcaverns_underworld_glowing_pit_mapblocks(Average pit spacing measured in mapblocks) int 8 \ No newline at end of file +dfcaverns_underworld_glowing_pit_mapblocks(Average pit spacing measured in mapblocks) int 8 + +[Underworld feature HUD] + +dfcaverns_underworld_hud_requires_item (Require an item to view waypoints) bool true +#Players can still discover the locations of volcanoes without this, but waypoints +#will only be visible in their hud if they have this item in their inventory. You can also +#specify "group:groupname" here. Leave it blank to default to map:mapping_kit. +dfcaverns_underworld_hud_item_required (Specify the item or group required) string map:mapping_kit + + +dfcaverns_show_pits_in_hud (Show pit locations in HUD) bool true +dfcaverns_pit_discovery_range (Pit discovery range) int 60 +dfcaverns_pit_visibility_range (Pit visibility range) int 500 + +dfcaverns_show_seals_in_hud (Seal locations in HUD) bool true +dfcaverns_seal_discovery_range (Seal discovery range) int 10 +dfcaverns_seal_visibility_range (Seal visibility range) int 200 + +dfcaverns_show_ruins_in_hud (Ruin locations visible in HUD) bool true +dfcaverns_ruin_discovery_range (Ruin discovery range) int 40 +dfcaverns_ruin_visibility_range (Ruin visibility range) int 250 + +[Primordial] +dfcaverns_enable_primordial (Generate primordial caverns) bool true +dfcaverns_primordial_max (Upper limit of primordial caverns) int -3393 +dfcaverns_primordial_min (Lower limit of primordial caverns) int -4032 + +# This setting is pretty technical, it spreads out the +# construction of giant mycelium networks on mapgen +# over this many seconds. If you're experiencing lag spikes +# during mapgen of Primordial cavern layer mushroom caverns +# then increasing this number may help. +dcaverns_giant_mycelium_timer_spread (Giant Mycelium mapgen timer spread) int 10 \ No newline at end of file diff --git a/df_caverns/shared.lua b/df_caverns/shared.lua index 208e89b..2a4948c 100644 --- a/df_caverns/shared.lua +++ b/df_caverns/shared.lua @@ -124,6 +124,9 @@ local content_in_list=function(content, list) end df_caverns.tunnel_floor = function(minp, maxp, area, vi, nvals_cracks, data, data_param2, wet) + if maxp.y > -30 then + wet = false + end local ystride = area.ystride local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local cracks = nvals_cracks[index2d] @@ -148,6 +151,10 @@ df_caverns.tunnel_floor = function(minp, maxp, area, vi, nvals_cracks, data, dat end df_caverns.tunnel_ceiling = function(minp, maxp, area, vi, nvals_cracks, data, data_param2, wet) + if maxp.y > -30 then + wet = false + end + local ystride = area.ystride local index2d = mapgen_helper.index2di(minp, maxp, area, vi) local cracks = nvals_cracks[index2d] @@ -207,4 +214,37 @@ df_caverns.place_shrub = function(vi, area, data, param2_data, shrub_list) local shrub = shrub_list[math.random(#shrub_list)] shrub(vi, area, data, param2_data) +end + +--------------------------------------------------------------------------------- +-- This method allows subterrane to overgenerate caves without destroying any of the decorations +local dfcaverns_nodes = nil +local dfcaverns_mods = { + "df_farming:", + "df_mapitems:", + "df_primordial_items:", + "df_trees:", + "df_underworld_items:", + "ice_sprites:", + "mine_gas:", +} +df_caverns.is_ground_content = function(c_node) + if dfcaverns_nodes then + return not dfcaverns_nodes[c_node] + end + dfcaverns_nodes = {} + for k, v in pairs(minetest.registered_nodes) do + for _, prefix in ipairs(dfcaverns_mods) do + if k:sub(1, #prefix) == prefix then + dfcaverns_nodes[minetest.get_content_id(k)] = true + end + end + end + dfcaverns_nodes[minetest.get_content_id("default:ice")] = true -- needed for nethercap cavern water covering + dfcaverns_nodes[minetest.get_content_id("oil:oil_source")] = true -- needed for blackcap oil slicks + if minetest.get_modpath("fireflies") then + dfcaverns_nodes[minetest.get_content_id("fireflies:firefly")] = true -- used in the primordial caverns + end + dfcaverns_mods = nil + return not dfcaverns_nodes[c_node] end \ No newline at end of file diff --git a/df_caverns/sunless_sea.lua b/df_caverns/sunless_sea.lua index d4888bb..920ff5c 100644 --- a/df_caverns/sunless_sea.lua +++ b/df_caverns/sunless_sea.lua @@ -107,7 +107,7 @@ local mushroom_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, da if math.random() < 0.01 then df_trees.spawn_tower_cap_vm(vi+ystride, area, data) 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, data_param2) elseif math.random() < 0.02 then df_trees.spawn_spindlestem_vm(vi+ystride, area, data, data_param2) end @@ -131,7 +131,7 @@ local fungispore_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, if math.random() < 0.025 then df_trees.spawn_fungiwood_vm(vi+ystride, area, data) elseif math.random() < 0.025 then - df_trees.spawn_spore_tree_vm(vi+ystride, area, data) + df_trees.spawn_spore_tree_vm(vi+ystride, area, data, data_param2) end end end @@ -223,15 +223,20 @@ local decorate_sunless_sea = function(minp, maxp, seed, vm, node_arrays, area, d data[vi] = c_obsidian end end - -- convert all air below sea level into water - if y <= sea_level and data[vi] == c_air then - data[vi] = c_water - end else skip_next = false end end + if minp.y <= sea_level then + for vi, x, y, z in area:iterp_yxz(area.MinEdge, area.MaxEdge) do + -- convert all air below sea level into water + if y <= sea_level and data[vi] == c_air then + data[vi] = c_water + end + end + end + --------------------------------------------------------- -- Cavern floors @@ -375,6 +380,7 @@ local decorate_sunless_sea = function(minp, maxp, seed, vm, node_arrays, area, d else data[vi] = c_coral_table[math.random(1,3)] data_param2[vi] = math.random(1,4)-1 + minetest.get_node_timer(area:position(vi)):start(math.random(10, 60)) end end end @@ -401,4 +407,5 @@ subterrane.register_layer({ }, decorate = decorate_sunless_sea, double_frequency = false, + is_ground_content = df_caverns.is_ground_content, }) diff --git a/df_caverns/surface_tunnels.lua b/df_caverns/surface_tunnels.lua index cad9f6e..b4b81c4 100644 --- a/df_caverns/surface_tunnels.lua +++ b/df_caverns/surface_tunnels.lua @@ -1,8 +1,11 @@ -- surface tunnels -local y_max = -10 +local y_max = 200 local y_min = df_caverns.config.ymax +local c_stone = minetest.get_content_id("default:stone") +local c_air = minetest.get_content_id("air") + minetest.register_on_generated(function(minp, maxp, seed) --if out of range of cave definition limits, abort if minp.y > y_max or maxp.y < y_min then @@ -12,36 +15,55 @@ minetest.register_on_generated(function(minp, maxp, seed) local t_start = os.clock() local vm, data, data_param2, area = mapgen_helper.mapgen_vm_data_param2() + + local eminp = {x=minp.x, y=area.MinEdge.y, z=minp.z} + local emaxp = {x=maxp.x, y=area.MaxEdge.y, z=maxp.z} + local minp_y = minp.y + local maxp_y = maxp.y + local humiditymap = minetest.get_mapgen_object("humiditymap") local nvals_cracks = mapgen_helper.perlin2d("df_cavern:cracks", minp, maxp, df_caverns.np_cracks) - local previous_state = "outside_region" - local previous_y = minp.y + local previous_y = eminp.y-1 - for vi, x, y, z in area:iterp_yxz(minp, maxp) do + local previous_potential_floor_vi + local previous_potential_floor_y + local previous_node + + for vi, x, y, z in area:iterp_yxz(eminp, emaxp) do if y < previous_y then - previous_state = "outside_region" + -- we've started a new column, initialize everything + previous_potential_floor_vi = nil + previous_potential_floor_y = nil + previous_node = nil end previous_y = y - if y < y_max then - if mapgen_helper.buildable_to(data[vi]) then - if previous_state == "in_rock" and not mapgen_helper.buildable_to(data[vi-area.ystride]) then - local index2d = mapgen_helper.index2d(minp, maxp, x, z) - local humidity = humiditymap[index2d] - df_caverns.tunnel_floor(minp, maxp, area, vi-area.ystride, nvals_cracks, data, data_param2, humidity > 30) + local current_node = data[vi] + if previous_node and y < y_max then + if current_node == c_air and previous_node == c_stone then + -- this may be a floor, but only if we eventually hit a ceiling in this column + previous_potential_floor_vi = vi-area.ystride + previous_potential_floor_y = y-1 + elseif current_node == c_stone and previous_node == c_air and previous_potential_floor_vi then + -- we hit a ceiling after passing through a floor + local index2d = mapgen_helper.index2d(minp, maxp, x, z) + local humidity = humiditymap[index2d] + if previous_potential_floor_y <= maxp_y and previous_potential_floor_y >= minp_y then + df_caverns.tunnel_floor(minp, maxp, area, previous_potential_floor_vi, nvals_cracks, data, data_param2, humidity > 30) end - previous_state = "in_tunnel" - else - if previous_state == "in_tunnel" and not mapgen_helper.buildable_to(data[vi]) then - local index2d = mapgen_helper.index2d(minp, maxp, x, z) - local humidity = humiditymap[index2d] + if y <= maxp_y and y >= minp_y then df_caverns.tunnel_ceiling(minp, maxp, area, vi, nvals_cracks, data, data_param2, humidity > 30) end - previous_state = "in_rock" + previous_potential_floor_vi = nil + elseif not mapgen_helper.buildable_to(current_node) then + -- we've entered a non-stone ceiling of some kind. Abort potential floor-ceiling pair detection. + previous_potential_floor_vi = nil end end + previous_node = current_node + end --send data back to voxelmanip @@ -55,12 +77,6 @@ minetest.register_on_generated(function(minp, maxp, seed) --write it to world vm:write_to_map() - local chunk_generation_time = math.ceil((os.clock() - t_start) * 1000) --grab how long it took - if chunk_generation_time < 1000 then - minetest.log("info", "[df_caverns surface tunnels] "..chunk_generation_time.." ms") --tell people how long - else - minetest.log("warning", "[df_caverns surface tunnels] took "..chunk_generation_time.." ms to generate map block " - .. minetest.pos_to_string(minp) .. minetest.pos_to_string(maxp)) - end - + local time_taken = os.clock() - t_start -- how long this chunk took, in seconds + mapgen_helper.record_time("df_caverns surface tunnels", time_taken) end) diff --git a/df_caverns/underworld.lua b/df_caverns/underworld.lua index 5f3cd44..7738be3 100644 --- a/df_caverns/underworld.lua +++ b/df_caverns/underworld.lua @@ -1,10 +1,82 @@ if not df_caverns.config.enable_underworld or not minetest.get_modpath("df_underworld_items") then return end +local modpath = minetest.get_modpath(minetest.get_current_modname()) + +local S = minetest.get_translator("df_caverns") local bones_loot_path = minetest.get_modpath("bones_loot") +local named_waypoints_path = minetest.get_modpath("named_waypoints") +local namegen_path = minetest.get_modpath("namegen") + +local name_pit = function() end +local name_ruin = function() end + +if named_waypoints_path then + + local item_required = nil + if minetest.settings:get_bool("dfcaverns_underworld_hud_requires_item", true) then + local setting_item_required = minetest.settings:get("dfcaverns_underworld_hud_item_required") + if setting_item_required == nil or setting_item_required == "" then + setting_item_required = "map:mapping_kit" + end + item_required = setting_item_required + end + + local pit_waypoint_def = { + default_name = S("A glowing pit"), + default_color = 0xFF88FF, + discovery_volume_radius = tonumber(minetest.settings:get("dfcaverns_pit_discovery_range")) or 60, + visibility_requires_item = item_required, + } + + if minetest.settings:get_bool("dfcaverns_show_pits_in_hud", true) then + pit_waypoint_def.visibility_volume_radius = tonumber(minetest.settings:get("dfcaverns_pit_visibility_range")) or 500 + pit_waypoint_def.on_discovery = named_waypoints.default_discovery_popup + end + named_waypoints.register_named_waypoints("glowing_pits", pit_waypoint_def) + + local seal_waypoint_def = { + default_name = S("Mysterious seal"), + default_color = 0x9C2233, + discovery_volume_radius = tonumber(minetest.settings:get("dfcaverns_seal_discovery_range")) or 10, + visibility_requires_item = item_required, + } + + if minetest.settings:get_bool("dfcaverns_show_seals_in_hud", true) then + seal_waypoint_def.visibility_volume_radius = tonumber(minetest.settings:get("dfcaverns_seal_visibility_range")) or 200 + seal_waypoint_def.on_discovery = named_waypoints.default_discovery_popup + end + named_waypoints.register_named_waypoints("puzzle_seals", seal_waypoint_def) + + if namegen_path then + namegen.parse_lines(io.lines(modpath.."/underworld_names.cfg")) + + name_pit = function() + return namegen.generate("glowing_pits") + end + name_ruin = function() + return namegen.generate("underworld_ruins") + end + + local underworld_ruin_def = { + default_name = S("Ancient ruin"), + discovery_volume_radius = tonumber(minetest.settings:get("dfcaverns_ruin_discovery_range")) or 40, + visibility_requires_item = item_required, + } + if minetest.settings:get_bool("dfcaverns_show_ruins_in_hud", true) then + underworld_ruin_def.visibility_volume_radius = tonumber(minetest.settings:get("dfcaverns_ruin_visibility_range")) or 250 + underworld_ruin_def.on_discovery = named_waypoints.default_discovery_popup + end + + named_waypoints.register_named_waypoints("underworld_ruins", underworld_ruin_def) + end +end + + local c_slade = minetest.get_content_id("df_underworld_items:slade") +local c_slade_block = minetest.get_content_id("df_underworld_items:slade_block") local c_air = minetest.get_content_id("air") local c_water = minetest.get_content_id("default:water_source") @@ -60,6 +132,9 @@ local y_min = median - 2*wave_mult + floor_displace - 2*floor_mult --df_caverns.config.underworld_min = y_min +--local poisson = mapgen_helper.get_poisson_points({x=-32000, z=-32000}, {x=32000, z=32000}, 1000) +--minetest.debug(dump(poisson.objects)) + --------------------------------------------------------- -- Buildings @@ -67,8 +142,11 @@ local oubliette_threshold = 0.8 local town_threshold = 1.1 local local_random = function(x, z) + local next_seed = math.floor(math.random()*2^21) math.randomseed(x + z*2^16) - return math.random() + local ret = math.random() + math.randomseed(next_seed) + return ret end -- create a deterministic list of buildings @@ -196,9 +274,9 @@ local pit_region_size = region_mapblocks * mapgen_chunksize * 16 local scatter_2d = function(min_xz, gridscale, border_width) local bordered_scale = gridscale - 2 * border_width local point = {} - point.x = math.random() * bordered_scale + min_xz.x + border_width + point.x = math.floor(math.random() * bordered_scale + min_xz.x + border_width) point.y = 0 - point.z = math.random() * bordered_scale + min_xz.z + border_width + point.z = math.floor(math.random() * bordered_scale + min_xz.z + border_width) return point end @@ -207,19 +285,19 @@ local get_corner = function(pos) return {x = math.floor((pos.x+32) / pit_region_size) * pit_region_size - 32, z = math.floor((pos.z+32) / pit_region_size) * pit_region_size - 32} end -local mapgen_seed = tonumber(minetest.get_mapgen_setting("seed")) +local mapgen_seed = tonumber(minetest.get_mapgen_setting("seed")) % 2^21 local get_pit = function(pos) if region_mapblocks < 1 then return nil end local corner_xz = get_corner(pos) - local next_seed = math.floor(math.random() * 2^31) + local next_seed = math.floor(math.random() * 2^21) math.randomseed(corner_xz.x + corner_xz.z * 2 ^ 8 + mapgen_seed) local location = scatter_2d(corner_xz, pit_region_size, radius_pit_max + radius_pit_variance) local variance_multiplier = math.random() local radius = variance_multiplier * (radius_pit_max - 15) + 15 local variance = radius_pit_variance/2 + radius_pit_variance*variance_multiplier/2 - local depth = math.random(plasma_depth_min, plasma_depth_max) + local depth = math.random(plasma_depth_min, plasma_depth_max) math.randomseed(next_seed) return {location = location, radius = radius, variance = variance, depth = depth} end @@ -242,11 +320,12 @@ minetest.register_chatcommand("find_pit", { func = function(name, param) local player = minetest.get_player_by_name(name) local pit = get_pit(player:get_pos()) - minetest.chat_send_player(name, "Pit location: x=" .. math.floor(pit.location.x) .. " z=" .. math.floor(pit.location.z)) + if pit then + minetest.chat_send_player(name, "Pit location: x=" .. math.floor(pit.location.x) .. " z=" .. math.floor(pit.location.z)) + end end, }) - minetest.register_on_generated(function(minp, maxp, seed) --if out of range of cave definition limits, abort @@ -266,7 +345,7 @@ minetest.register_on_generated(function(minp, maxp, seed) local pit = get_pit(minp) --minetest.chat_send_all(minetest.pos_to_string(pit.location)) - + local buildings = get_buildings(emin, emax, nvals_zone) local pit_uninitialized = true @@ -279,8 +358,16 @@ minetest.register_on_generated(function(minp, maxp, seed) local wave = nvals_wave[index2d] * wave_mult local floor_height = math.floor(abs_cave * floor_mult + median + floor_displace + wave) + + if named_waypoints_path and floor_height == y and pit and pit.location.x == x and pit.location.z == z then + named_waypoints.add_waypoint("glowing_pits", {x=x, y=y, z=z}, {name=name_pit()}) + end + + local underside_height = math.floor(y_min + math.abs(wave) / 5)+2 -- divide wave by five to smooth out the underside of the slade, we only want the interface to ripple a little down here local ceiling_height = math.floor(abs_cave * ceiling_mult + median + ceiling_displace + wave) - if y < floor_height and y > y_min + math.abs(wave) / 5 then -- divide wave by five to smooth out the underside of the slade, we only want the interface to ripple a little down here + if (y == underside_height or y == underside_height - 1) and (x % 8 == 0 or z % 8 == 0) then + data[vi] = c_air + elseif y < floor_height and y > underside_height then data[vi] = c_slade if pit and pit.location.x - radius_pit_max - radius_pit_variance < maxp.x and @@ -290,13 +377,13 @@ minetest.register_on_generated(function(minp, maxp, seed) then -- there's a pit nearby if pit_uninitialized then - nvals_pit, area_pit = mapgen_helper.perlin3d("df_cavern:perlin_cave", minp, maxp, perlin_pit) -- determine which areas are spongey with warrens + nvals_pit, area_pit = mapgen_helper.perlin3d("df_cavern:perlin_cave", minp, maxp, perlin_pit) pit_uninitialized = false end local pit_value = nvals_pit[area_pit:index(x,y,z)] * pit.variance local distance = vector.distance({x=x, y=y, z=z}, {x=pit.location.x, y=y, z=pit.location.z}) + pit_value - if distance < pit.radius -3 then - if y < median + floor_displace + wave - pit.depth then + if distance < pit.radius -2.5 then + if y < median + floor_displace + wave - pit.depth or y < underside_height + plasma_depth_min then data[vi] = c_pit_plasma else data[vi] = c_air @@ -308,8 +395,8 @@ minetest.register_on_generated(function(minp, maxp, seed) df_underworld_items.underworld_shard(data, area, vi) end end - end - elseif y < ceiling_height and data[vi] ~= c_amethyst then + end + elseif y >= floor_height and y < ceiling_height and data[vi] ~= c_amethyst then data[vi] = c_air elseif data[vi] == c_water then data[vi] = c_air -- no water down here @@ -369,7 +456,7 @@ minetest.register_on_generated(function(minp, maxp, seed) building.pos.y = floor_height --minetest.chat_send_all("placing " .. building.building_type .. " at " .. minetest.pos_to_string(building.pos)) if building.building_type == "oubliette" then - mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, oubliette_schematic) + mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, oubliette_schematic) elseif building.building_type == "open oubliette" then mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, oubliette_schematic, 0, {["df_underworld_items:slade_seal"] = "air"}) elseif building.building_type == "lamppost" then @@ -378,6 +465,11 @@ minetest.register_on_generated(function(minp, maxp, seed) mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, small_building_schematic, building.rotation) elseif building.building_type == "medium building" then mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, medium_building_schematic, building.rotation) + if named_waypoints_path and namegen_path then + if not next(named_waypoints.get_waypoints_in_area("underworld_ruins", vector.subtract(building.pos, 250), vector.add(building.pos, 250))) then + named_waypoints.add_waypoint("underworld_ruins", {x=building.pos.x, y=floor_height+1, z=building.pos.z}, {name=name_ruin()}) + end + end elseif building.building_type == "small slab" then mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, small_slab_schematic, building.rotation) else @@ -388,6 +480,25 @@ minetest.register_on_generated(function(minp, maxp, seed) end end end + + -- puzzle seal + local puzzle_seal = nil + if pit_uninitialized and math.random() < 0.05 then + local index2d = mapgen_helper.index2d(emin, emax, minp.x + 3, minp.z + 3) + local abs_cave = math.abs(nvals_cave[index2d]) -- range is from 0 to approximately 2, with 0 being connected and 2s being islands + local wave = nvals_wave[index2d] * wave_mult + + local floor_height = math.floor(abs_cave * floor_mult + median + floor_displace + wave) + local underside_height = math.floor(y_min + math.abs(wave) / 5) + + if floor_height < maxp.y and floor_height > minp.y then + for plat_vi in area:iter(minp.x, floor_height-6, minp.z, minp.x+6, floor_height, minp.z+6) do + data[plat_vi] = c_slade_block + end + puzzle_seal = {x=minp.x+3, y=floor_height+1, z=minp.z+3} + minetest.log("info", "Puzzle seal generated at " .. minetest.pos_to_string(puzzle_seal)) + end + end --send data back to voxelmanip vm:set_data(data) @@ -399,6 +510,17 @@ minetest.register_on_generated(function(minp, maxp, seed) --write it to world vm:write_to_map() + if puzzle_seal ~= nil then + if named_waypoints_path then + named_waypoints.add_waypoint("puzzle_seals", puzzle_seal) + end + + minetest.place_schematic({x=puzzle_seal.x-3, y=puzzle_seal.y, z=puzzle_seal.z-3}, df_underworld_items.seal_temple_schem, 0, {}, true) + local node_name = minetest.get_node(puzzle_seal).name + local node_def = minetest.registered_nodes[node_name] + node_def.on_construct(puzzle_seal) + end + if bones_loot_path then for i = 1, 30 do local x = math.random(minp.x, maxp.x) @@ -406,7 +528,7 @@ minetest.register_on_generated(function(minp, maxp, seed) local index2d = mapgen_helper.index2d(emin, emax, x, z) local abs_cave = math.abs(nvals_cave[index2d]) -- range is from 0 to approximately 2, with 0 being connected and 2s being islands local wave = nvals_wave[index2d] * wave_mult - local floor_height = math.floor(abs_cave * floor_mult + median + floor_displace + wave) + local floor_height = math.floor(abs_cave * floor_mult + median + floor_displace + wave)-1 local ceiling_height = math.floor(abs_cave * ceiling_mult + median + ceiling_displace + wave) if floor_height < ceiling_height then local zone = math.abs(nvals_zone[index2d]) @@ -433,11 +555,6 @@ minetest.register_on_generated(function(minp, maxp, seed) end end - local chunk_generation_time = math.ceil((os.clock() - t_start) * 1000) --grab how long it took - if chunk_generation_time < 1000 then - minetest.log("info", "[df_caverns] underworld mapblock generation took "..chunk_generation_time.." ms") --tell people how long - else - minetest.log("warning", "[df_caverns] underworld took "..chunk_generation_time.." ms to generate map block " - .. minetest.pos_to_string(minp) .. minetest.pos_to_string(maxp)) - end + local time_taken = os.clock() - t_start -- how long this chunk took, in seconds + mapgen_helper.record_time("df_caverns underworld", time_taken) end) diff --git a/df_caverns/underworld_names.cfg b/df_caverns/underworld_names.cfg new file mode 100644 index 0000000..97f7ed6 --- /dev/null +++ b/df_caverns/underworld_names.cfg @@ -0,0 +1,18 @@ +name "glowing_pits" { + customGroupA = "Actinic, Amethyst, Angry, Atrocious, Bad, Blighted, Baneful, Baleful, Beastly, Calamitous, Corrupt, Crazed, Damnable, Demoniacal, Demonic, Depraved, Destructive, Devilish, Diabolical, Disastrous, Execrable, Fiendish, Foul, Frenzied, Glaring, Harmful, Hateful, Heinous, Hellish, Hideous, Infernal, Iniquitous, Injurious, Loathsome, Lost, Maleficent, Malevolent, Malicious, Malignant, Manic, Nefarious, Nightmare, Obscene, Offensive, Pernicious, Poison, Possessed, Rancorous, Repugnant, Repulsive, Revolting, Spiteful, Unhallowed, Unpleasant, Vicious, Vile, Villainous, Violent, Wicked, Wrathful" + + customGroupB = "Abyss, Aperture, Breach, Cavity, Chasm, Crevasse, Depth, Deep, Fissure, Funnel, Gate, Gulf, Hell, Hole, Hollow, Inferno, Maw, Mouth, Opening, Pit, Portal, Puncture, Ravager, Rent, Rift, Rim, Schism, Shaft, Split, Throat, Void, Well" + + customGroupC = "Adversity, Affliction, Annihilation, Bale, Bane, Blight, Calamity, Cataclysm, Catastrophe, Collapse, Conclusion, Condemnation, Death, Defeat, Destiny, Destruction, Disaster, Doom, Downfall, Failure, Grief, Harm, Hazard, Judgment, Karma, Misadventure, Mischance, Misfortune, Mishap, Ruin, Ruination, Tragedy, Undoing, Verdict, Woe" + + rules = "%50The_$A_$B, The_$B_of_$C, %10The_$A_$B_of_$C" +} + +name "underworld_ruins" { + + customGroupA = "Abandoned, Absent, Adrift, Alien, Anonymous, Bare, Barren, Blank, Buried, Clandestine, Cloaked, Concealed, Covered, Cryptic, Dark, Dead, Depleted, Deserted, Desolate, Despoiled, Destitute, Devoid, Disappeared, Distant, Exhausted, Empty, Forfeit, Forfeited, Forsaken, Hidden, Incognito, Indiscernible, Invisible, Irretrievable, Irrevocable, Masked, Mislaid, Misplaced, Mystic, Mystical, Nameless, Obscured, Secluded, Secret, Sequestered, Shadowy, Shrouded, Stark, Strange, Uncelebrated, Uncharted, Undiscovered, Unexplained, Unexplored, Unfamiliar, Unfilled, Unidentified, Unknown, Unnamed, Unredeemed, Unsung, Untold, Vacant, Vacated, Vanished, Veiled, Wayward, Warrior's, King's, Knave's, Coward's, Cardinal's, Priest's, Soldier's, Noble, Steadfast, Children's, Howling, Silent, Grinding, Dusty" + + customGroupB = "Temple, Chapel, House, Sanctuary, Shrine, Fortress, Tomb, Crypt, Graves, Citadel, Garrison, Rampart, Redoubt, Refuge, Asylum, Haven, Hideout, Retreat, Shelter, Stronghold, Covert, Den, Settlement, Preserve, Seat, Watch, Bulwark, Necropolis, Catacomb, Ruin, Hulk, Wreck" + + rules = "The_$A_$B" +} \ No newline at end of file diff --git a/df_farming/cave_wheat.lua b/df_farming/cave_wheat.lua index bf5056f..71c93fb 100644 --- a/df_farming/cave_wheat.lua +++ b/df_farming/cave_wheat.lua @@ -17,11 +17,18 @@ local register_cave_wheat = function(number) inventory_image = "dfcaverns_cave_wheat_"..tostring(number)..".png", paramtype = "light", walkable = false, + is_ground_content = false, buildable_to = true, floodable = true, groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11}, sounds = default.node_sound_leaves_defaults(), - + selection_box = { + type = "fixed", + fixed = { + {-8/16, -8/16, -8/16, 8/16, -8/16 + 2*number/16, 8/16}, + }, + }, + on_timer = function(pos, elapsed) df_farming.grow_underground_plant(pos, name, elapsed) end, @@ -96,12 +103,15 @@ minetest.register_craft({ burntime = 2 }) +------------- +--- Flour and bread + minetest.register_craftitem("df_farming:cave_flour", { description = S("Cave Wheat Flour"), _doc_items_longdesc = df_farming.doc.cave_flour_desc, _doc_items_usagehelp = df_farming.doc.cave_flour_usage, inventory_image = "dfcaverns_flour.png", - groups = {flammable = 1, dfcaverns_cookable = 1}, + groups = {flammable = 1, dfcaverns_cookable = 1, food_flour = 1}, }) minetest.register_craftitem("df_farming:cave_bread", { @@ -109,6 +119,7 @@ minetest.register_craftitem("df_farming:cave_bread", { _doc_items_longdesc = df_farming.doc.cave_bread_desc, _doc_items_usagehelp = df_farming.doc.cave_bread_usage, inventory_image = "dfcaverns_prepared_food13x16.png", + sound = {eat = {name = "df_farming_chomp_crunch", gain = 1.0}}, on_use = minetest.item_eat(5), groups = {flammable = 2, food = 5}, }) @@ -146,3 +157,72 @@ minetest.register_craft({ output = "df_farming:cave_bread", recipe = "df_farming:cave_flour" }) + +-------- +-- Straw + +minetest.register_node("df_farming:cave_straw", { + description = S("Cave Straw"), + tiles = {"dfcaverns_cave_straw.png"}, + is_ground_content = false, + groups = {snappy=3, flammable=4, fall_damage_add_percent=-30, straw=1}, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_craft({ + output = "df_farming:cave_straw 3", + recipe = { + {"df_farming:cave_wheat", "df_farming:cave_wheat", "df_farming:cave_wheat"}, + {"df_farming:cave_wheat", "df_farming:cave_wheat", "df_farming:cave_wheat"}, + {"df_farming:cave_wheat", "df_farming:cave_wheat", "df_farming:cave_wheat"}, + } +}) + +minetest.register_craft({ + output = "df_farming:cave_wheat 3", + recipe = { + {"df_farming:cave_straw"}, + } +}) + + +--------- +-- Trample support + +if minetest.get_modpath("trail") and trail and trail.register_trample_node then + minetest.register_node("df_farming:wheat_trampled", { + description = S("Flattened Cave Wheat"), + tiles = {"dfcaverns_cave_wheat_flattened.png"}, + inventory_image = "dfcaverns_cave_wheat_flattened.png", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + buildable_to = true, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -3 / 8, 0.5} + }, + }, + groups = {snappy = 3, flammable = 2, attached_node = 1}, + drop = "", + sounds = default.node_sound_leaves_defaults(), + }) + + trail.register_trample_node("df_farming:cave_wheat_5", { + trampled_node_name = "df_farming:wheat_trampled", + randomize_trampled_param2 = true, + }) + trail.register_trample_node("df_farming:cave_wheat_6", { + trampled_node_name = "df_farming:wheat_trampled", + randomize_trampled_param2 = true, + }) + trail.register_trample_node("df_farming:cave_wheat_7", { + trampled_node_name = "df_farming:wheat_trampled", + randomize_trampled_param2 = true, + }) + trail.register_trample_node("df_farming:cave_wheat_8", { + trampled_node_name = "df_farming:wheat_trampled", + randomize_trampled_param2 = true, + }) +end \ No newline at end of file diff --git a/df_farming/config.lua b/df_farming/config.lua index f5711ab..b0223cc 100644 --- a/df_farming/config.lua +++ b/df_farming/config.lua @@ -7,11 +7,11 @@ local print_settingtypes = false local function setting(stype, name, default, description) local value if stype == "bool" then - value = minetest.setting_getbool(CONFIG_FILE_PREFIX..name) + value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name, default) elseif stype == "string" then - value = minetest.setting_get(CONFIG_FILE_PREFIX..name) + value = minetest.settings:get(CONFIG_FILE_PREFIX..name) elseif stype == "int" or stype == "float" then - value = tonumber(minetest.setting_get(CONFIG_FILE_PREFIX..name)) + value = tonumber(minetest.settings:get(CONFIG_FILE_PREFIX..name)) end if value == nil then value = default @@ -34,7 +34,7 @@ local plants = { --Plants -setting("int", "plant_growth_time", 500, "Base plant growth time") +setting("int", "plant_growth_time", 3600, "Base plant growth time") -- 60 minutes for _, plant in pairs(plants) do setting("float", plant.name.."_delay_multiplier", plant.delay_multiplier, plant.name.." growth delay multiplier") diff --git a/df_farming/cooking.lua b/df_farming/cooking.lua index cabe61a..4a4cb86 100644 --- a/df_farming/cooking.lua +++ b/df_farming/cooking.lua @@ -11,6 +11,7 @@ local register_cooking_recipes = function(def) _doc_items_longdesc = df_farming.doc.simple_meal_desc, _doc_items_usagehelp = df_farming.doc.simple_meal_usage, inventory_image = def.simple.image, + sound = def.simple.sound, on_use = minetest.item_eat(4), groups = {food = 4}, }) @@ -19,6 +20,7 @@ local register_cooking_recipes = function(def) _doc_items_longdesc = df_farming.doc.medium_meal_desc, _doc_items_usagehelp = df_farming.doc.medium_meal_usage, inventory_image = def.medium.image, + sound = def.medium.sound, on_use = minetest.item_eat(6), groups = {food = 6}, }) @@ -27,6 +29,7 @@ local register_cooking_recipes = function(def) _doc_items_longdesc = df_farming.doc.complex_meal_desc, _doc_items_usagehelp = df_farming.doc.complex_meal_usage, inventory_image = def.complex.image, + sound = def.complex.sound, on_use = minetest.item_eat(8), groups = {food = 8}, }) @@ -63,65 +66,71 @@ end -- prefix =, -- item =, -- replacements =, --- simple = {name = , image = }, --- medium = {name = , image = }, --- complex = {name = , image = }, +-- simple = {name = , image = , sound = }, +-- medium = {name = , image = , sound = }, +-- complex = {name = , image = , sound = }, --} +local chomp = {eat = {name = "df_farming_chomp_crunch", gain = 1.0}} +local crisp = {eat = {name = "df_farming_crisp_chew", gain = 1.0}} +local gummy = {eat = {name = "df_farming_gummy_chew", gain = 1.0}} +local mushy = {eat = {name = "df_farming_mushy_chew", gain = 1.0}} +local soft = {eat = {name = "df_farming_soft_chew", gain = 1.0}} + register_cooking_recipes({prefix="df_farming", item="cave_flour", - simple = {name=S("Cave Wheat Flour Biscuit"), image="dfcaverns_prepared_food08x16.png"}, - medium = {name=S("Cave Wheat Flour Bun"), image="dfcaverns_prepared_food11x16.png"}, - complex = {name=S("Cave Wheat Flour Pancake"), image="dfcaverns_prepared_food07x16.png"}, + simple = {name=S("Cave Wheat Flour Biscuit"), image="dfcaverns_prepared_food08x16.png", sound = crisp}, + medium = {name=S("Cave Wheat Flour Bun"), image="dfcaverns_prepared_food11x16.png", sound = mushy}, + complex = {name=S("Cave Wheat Flour Pancake"), image="dfcaverns_prepared_food07x16.png", sound = mushy}, }) register_cooking_recipes({prefix="df_farming", item="cave_wheat_seed", - simple = {name=S("Cave Wheat Seed Loaf"), image="dfcaverns_prepared_food17x16.png"}, - medium = {name=S("Cave Wheat Seed Puffs"), image="dfcaverns_prepared_food33x16.png"}, - complex = {name=S("Cave Wheat Seed Risotto"), image="dfcaverns_prepared_food14x16.png"}, + simple = {name=S("Cave Wheat Seed Loaf"), image="dfcaverns_prepared_food17x16.png", sound = crisp}, + medium = {name=S("Cave Wheat Seed Puffs"), image="dfcaverns_prepared_food33x16.png", sound = soft}, + complex = {name=S("Cave Wheat Seed Risotto"), image="dfcaverns_prepared_food14x16.png", sound = gummy}, }) register_cooking_recipes({prefix="df_farming", item="sweet_pod_seed", - simple = {name=S("Sweet Pod Spore Dumplings"), image="dfcaverns_prepared_food09x16.png"}, - medium = {name=S("Sweet Pod Spore Single Crust Pie"), image="dfcaverns_prepared_food05x16.png"}, - complex = {name=S("Sweet Pod Spore Brule"), image="dfcaverns_prepared_food22x16.png"}, + simple = {name=S("Sweet Pod Spore Dumplings"), image="dfcaverns_prepared_food09x16.png", sound = mushy}, + medium = {name=S("Sweet Pod Spore Single Crust Pie"), image="dfcaverns_prepared_food05x16.png", sound = mushy}, + complex = {name=S("Sweet Pod Spore Brule"), image="dfcaverns_prepared_food22x16.png", sound = soft}, }) register_cooking_recipes({prefix="df_farming", item="sugar", - simple = {name=S("Sweet Pod Sugar Cookie"), image="dfcaverns_prepared_food02x16.png"}, - medium = {name=S("Sweet Pod Sugar Gingerbread"), image="dfcaverns_prepared_food21x16.png"}, - complex = {name=S("Sweet Pod Sugar Roll"), image="dfcaverns_prepared_food25x16.png"}, + simple = {name=S("Sweet Pod Sugar Cookie"), image="dfcaverns_prepared_food02x16.png", sound = crisp}, + medium = {name=S("Sweet Pod Sugar Gingerbread"), image="dfcaverns_prepared_food21x16.png", sound = chomp}, + complex = {name=S("Sweet Pod Sugar Roll"), image="dfcaverns_prepared_food25x16.png", sound = crisp}, }) register_cooking_recipes({prefix="group", item="plump_helmet", - simple = {name=S("Plump Helmet Mince"), image="dfcaverns_prepared_food15x16.png"}, - medium = {name=S("Plump Helmet Stalk Sausage"), image="dfcaverns_prepared_food18x16.png"}, - complex = {name=S("Plump Helmet Roast"), image="dfcaverns_prepared_food04x16.png"}, + simple = {name=S("Plump Helmet Mince"), image="dfcaverns_prepared_food15x16.png", sound = mushy}, + medium = {name=S("Plump Helmet Stalk Sausage"), image="dfcaverns_prepared_food18x16.png", sound = gummy}, + complex = {name=S("Plump Helmet Roast"), image="dfcaverns_prepared_food04x16.png", sound = mushy}, }) register_cooking_recipes({prefix="df_farming", item="plump_helmet_spawn", - simple = {name=S("Plump Helmet Spawn Soup"), image="dfcaverns_prepared_food10x16.png"}, - medium = {name=S("Plump Helmet Spawn Jambalaya"), image="dfcaverns_prepared_food01x16.png"}, - complex = {name=S("Plump Helmet Sprout Stew"), image="dfcaverns_prepared_food26x16.png"}, + simple = {name=S("Plump Helmet Spawn Soup"), image="dfcaverns_prepared_food10x16.png", sound = gummy}, + medium = {name=S("Plump Helmet Spawn Jambalaya"), image="dfcaverns_prepared_food01x16.png", sound = soft}, + complex = {name=S("Plump Helmet Sprout Stew"), image="dfcaverns_prepared_food26x16.png", sound = gummy}, }) register_cooking_recipes({prefix="df_farming", item="quarry_bush_leaves", - simple = {name=S("Quarry Bush Leaf Spicy Bun"), image="dfcaverns_prepared_food23x16.png"}, - medium = {name=S("Quarry Bush Leaf Croissant"), image="dfcaverns_prepared_food29x16.png"}, - complex = {name=S("Stuffed Quarry Bush Leaf"), image="dfcaverns_prepared_food27x16.png"}, + simple = {name=S("Quarry Bush Leaf Spicy Bun"), image="dfcaverns_prepared_food23x16.png", sound = soft}, + medium = {name=S("Quarry Bush Leaf Croissant"), image="dfcaverns_prepared_food29x16.png", sound = soft}, + complex = {name=S("Stuffed Quarry Bush Leaf"), image="dfcaverns_prepared_food27x16.png", sound = chomp}, }) register_cooking_recipes({prefix="df_farming", item="quarry_bush_seed", - simple = {name=S("Rock Nut Bread"), image="dfcaverns_prepared_food16x16.png"}, - medium = {name=S("Rock Nut Cookie"), image="dfcaverns_prepared_food07x16.png"}, - complex = {name=S("Rock Nut Cake"), image="dfcaverns_prepared_food03x16.png"}, + simple = {name=S("Rock Nut Bread"), image="dfcaverns_prepared_food16x16.png", sound = soft}, + medium = {name=S("Rock Nut Cookie"), image="dfcaverns_prepared_food07x16.png", sound = chomp}, + complex = {name=S("Rock Nut Cake"), image="dfcaverns_prepared_food03x16.png", sound = soft}, }) register_cooking_recipes({prefix="df_farming", item="dimple_cup_seed", - simple = {name=S("Dimple Cup Spore Flatbread"), image="dfcaverns_prepared_food12x16.png"}, - medium = {name=S("Dimple Cup Spore Scone"), image="dfcaverns_prepared_food32x16.png"}, - complex = {name=S("Dimple Cup Spore Roll"), image="dfcaverns_prepared_food31x16.png"}, + simple = {name=S("Dimple Cup Spore Flatbread"), image="dfcaverns_prepared_food12x16.png", sound = crisp}, + medium = {name=S("Dimple Cup Spore Scone"), image="dfcaverns_prepared_food32x16.png", sound = chomp}, + complex = {name=S("Dimple Cup Spore Roll"), image="dfcaverns_prepared_food31x16.png", sound = soft}, }) register_cooking_recipes({prefix="df_farming", item="pig_tail_seed", - simple = {name=S("Pig Tail Spore Sandwich"), image="dfcaverns_prepared_food20x16.png"}, - medium = {name=S("Pig Tail Spore Tofu"), image="dfcaverns_prepared_food30x16.png"}, - complex = {name=S("Pig Tail Spore Casserole"), image="dfcaverns_prepared_food34x16.png"}, + simple = {name=S("Pig Tail Spore Sandwich"), image="dfcaverns_prepared_food20x16.png", sound = soft}, + medium = {name=S("Pig Tail Spore Tofu"), image="dfcaverns_prepared_food30x16.png", sound = gummy}, + complex = {name=S("Pig Tail Spore Casserole"), image="dfcaverns_prepared_food34x16.png", sound = mushy}, }) register_cooking_recipes({prefix="df_farming", item="dwarven_syrup_bucket", replacements={{"df_farming:dwarven_syrup_bucket", "bucket:bucket_empty"}}, - simple = {name=S("Dwarven Syrup Taffy"), image="dfcaverns_prepared_food19x16.png"}, - medium = {name=S("Dwarven Syrup Jellies"), image="dfcaverns_prepared_food06x16.png"}, - complex = {name=S("Dwarven Syrup Delight"), image="dfcaverns_prepared_food24x16.png"}, + simple = {name=S("Dwarven Syrup Taffy"), image="dfcaverns_prepared_food19x16.png", sound = gummy}, + medium = {name=S("Dwarven Syrup Jellies"), image="dfcaverns_prepared_food06x16.png", sound = gummy}, + complex = {name=S("Dwarven Syrup Delight"), image="dfcaverns_prepared_food24x16.png", sound = mushy}, }) -- dfcaverns_prepared_food28 is currently unused diff --git a/df_farming/depends.txt b/df_farming/depends.txt deleted file mode 100644 index 74ea25f..0000000 --- a/df_farming/depends.txt +++ /dev/null @@ -1,9 +0,0 @@ -default -farming? -cottages? -bucket? -dynamic_liquid? -wool? -intllib? -doc? -crafting? diff --git a/df_farming/description.txt b/df_farming/description.txt deleted file mode 100644 index 89a689a..0000000 --- a/df_farming/description.txt +++ /dev/null @@ -1 +0,0 @@ -Adds farmable underground plants that die in sunlight. Also includes various cooking reactions. \ No newline at end of file diff --git a/df_farming/dimple_cup.lua b/df_farming/dimple_cup.lua index 7c3ad71..303e7d6 100644 --- a/df_farming/dimple_cup.lua +++ b/df_farming/dimple_cup.lua @@ -16,9 +16,16 @@ local register_dimple_cup = function(number) paramtype = "light", walkable = false, floodable = true, + is_ground_content = false, buildable_to = true, groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, color_blue = 1, light_sensitive_fungus = 11, flower = 1}, sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { + {-8/16, -8/16, -8/16, 8/16, -8/16 + 4*number/16, 8/16}, + }, + }, on_timer = function(pos, elapsed) df_farming.grow_underground_plant(pos, name, elapsed) diff --git a/df_farming/mod.conf b/df_farming/mod.conf index b489d96..605f5cf 100644 --- a/df_farming/mod.conf +++ b/df_farming/mod.conf @@ -1,4 +1,4 @@ name = df_farming description = Adds farmable underground plants that die in sunlight. Also includes various cooking reactions. depends = default -optional_depends = farming, cottages, bucket, dynamic_liquid, wool, intllib, doc, crafting +optional_depends = farming, cottages, bucket, dynamic_liquid, wool, intllib, doc, crafting, trail diff --git a/df_farming/pig_tail.lua b/df_farming/pig_tail.lua index 4d4d1a2..7ab1ca6 100644 --- a/df_farming/pig_tail.lua +++ b/df_farming/pig_tail.lua @@ -17,10 +17,17 @@ local register_pig_tail = function(number) inventory_image = "dfcaverns_pig_tail_"..tostring(number)..".png", paramtype = "light", walkable = false, + is_ground_content = false, floodable = true, buildable_to = true, groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11}, sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { + {-8/16, -8/16, -8/16, 8/16, -8/16 + 2*number/16, 8/16}, + }, + }, on_timer = function(pos, elapsed) df_farming.grow_underground_plant(pos, name, elapsed) @@ -115,3 +122,40 @@ minetest.register_craft({ burntime = 1, }) +if minetest.get_modpath("trail") and trail and trail.register_trample_node then + minetest.register_node("df_farming:pig_tail_trampled", { + description = S("Flattened Pig Tail"), + tiles = {"dfcaverns_pig_tail_flattened.png"}, + inventory_image = "dfcaverns_pig_tail_flattened.png", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + buildable_to = true, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -3 / 8, 0.5} + }, + }, + groups = {snappy = 3, flammable = 2, attached_node = 1}, + drop = "", + sounds = default.node_sound_leaves_defaults(), + }) + + trail.register_trample_node("df_farming:pig_tail_5", { + trampled_node_name = "df_farming:pig_tail_trampled", + randomize_trampled_param2 = true, + }) + trail.register_trample_node("df_farming:pig_tail_6", { + trampled_node_name = "df_farming:pig_tail_trampled", + randomize_trampled_param2 = true, + }) + trail.register_trample_node("df_farming:pig_tail_7", { + trampled_node_name = "df_farming:pig_tail_trampled", + randomize_trampled_param2 = true, + }) + trail.register_trample_node("df_farming:pig_tail_8", { + trampled_node_name = "df_farming:pig_tail_trampled", + randomize_trampled_param2 = true, + }) +end \ No newline at end of file diff --git a/df_farming/plants.lua b/df_farming/plants.lua index becd5ed..3e7a4a6 100644 --- a/df_farming/plants.lua +++ b/df_farming/plants.lua @@ -15,6 +15,7 @@ minetest.register_node("df_farming:dead_fungus", { inventory_image = "dfcaverns_dead_fungus.png", paramtype = "light", walkable = false, + is_ground_content = false, buildable_to = true, floodable = true, groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, flow_through = 1}, @@ -47,6 +48,7 @@ minetest.register_node("df_farming:cavern_fungi", { inventory_image = "dfcaverns_fungi.png", paramtype = "light", walkable = false, + is_ground_content = false, buildable_to = true, floodable = true, light_source = 6, @@ -134,7 +136,7 @@ local place_seed = function(itemstack, placer, pointed_thing, plantname) -- add the node and remove 1 item from the itemstack minetest.add_node(pt.above, {name = plantname, param2 = 1}) df_farming.plant_timer(pt.above, plantname) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode", false) then itemstack:take_item() end return itemstack @@ -155,6 +157,7 @@ df_farming.register_seed = function(name, description, image, stage_one, grow_ti _dfcaverns_next_stage_time = grow_time, paramtype = "light", walkable = false, + is_ground_content = false, floodable = true, sunlight_propagates = true, selection_box = { @@ -180,6 +183,9 @@ df_farming.register_seed = function(name, description, image, stage_one, grow_ti end df_farming.grow_underground_plant = function(pos, plant_name, elapsed) + if df_farming.kill_if_sunlit(pos) then + return + end local node_def = minetest.registered_nodes[plant_name] local next_stage = node_def._dfcaverns_next_stage if next_stage then @@ -195,7 +201,33 @@ df_farming.grow_underground_plant = function(pos, plant_name, elapsed) end end +df_farming.kill_if_sunlit = function(pos, node) + return false +end if df_farming.config.light_kills_fungus then + local kill_if_sunlit = function(pos, node) + if not node then + node = minetest.get_node(pos) + end + local node_def = minetest.registered_nodes[node.name] + local light_sensitive_fungus_level = node_def.groups.light_sensitive_fungus + + -- This should never be the case, but I've received a report of it happening anyway in the ABM so guarding against it. + if not light_sensitive_fungus_level then return false end + + local dead_node = node_def._dfcaverns_dead_node or "df_farming:dead_fungus" + -- 11 is the value adjacent to a torch + local light_level = minetest.get_node_light(pos, 0.5) -- check at 0.5 to get how bright it would be here at noon, + -- prevents fungus from growing on the surface world by happenstance + if light_level and light_level > light_sensitive_fungus_level then + minetest.set_node(pos, {name=dead_node, param2 = node.param2}) + return true + end + return false + end + + df_farming.kill_if_sunlit = kill_if_sunlit + minetest.register_abm({ label = "df_farming:kill_light_sensitive_fungus", nodenames = {"group:light_sensitive_fungus"}, @@ -203,15 +235,7 @@ if df_farming.config.light_kills_fungus then interval = 30, chance = 5, action = function(pos, node) - local node_def = minetest.registered_nodes[node.name] - local light_sensitive_fungus_level = node_def.groups.light_sensitive_fungus - if not light_sensitive_fungus_level then return end -- This should never be the case, but I've received a report of it happening anyway so guarding against it. - local dead_node = node_def._dfcaverns_dead_node or "df_farming:dead_fungus" - -- 11 is the value adjacent to a torch - local light_level = minetest.get_node_light(pos) - if light_level and light_level > light_sensitive_fungus_level then - minetest.set_node(pos, {name=dead_node, param2 = node.param2}) - end + kill_if_sunlit(pos, node) end }) end diff --git a/df_farming/plump_helmet.lua b/df_farming/plump_helmet.lua index d78f6d8..6967572 100644 --- a/df_farming/plump_helmet.lua +++ b/df_farming/plump_helmet.lua @@ -50,7 +50,7 @@ local plump_helmet_on_place = function(itemstack, placer, pointed_thing, plantn -- add the node and remove 1 item from the itemstack minetest.add_node(pt.above, {name = plantname, param2 = math.random(0,3)}) df_farming.plant_timer(pt.above, plantname) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode", false) then itemstack:take_item() end return itemstack @@ -71,6 +71,7 @@ minetest.register_node("df_farming:plump_helmet_spawn", { paramtype = "light", paramtype2 = "facedir", walkable = false, + is_ground_content = false, floodable = true, node_box = { type = "fixed", @@ -103,6 +104,9 @@ minetest.register_node("df_farming:plump_helmet_1", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", + is_ground_content = false, + sounds = default.node_sound_leaves_defaults(), + sound = {eat = {name = "df_farming_gummy_chew", gain = 1.0}}, walkable = false, floodable = true, node_box = { @@ -140,7 +144,10 @@ minetest.register_node("df_farming:plump_helmet_2", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", + sounds = default.node_sound_leaves_defaults(), + sound = {eat = {name = "df_farming_gummy_chew", gain = 1.0}}, walkable = false, + is_ground_content = false, floodable = true, node_box = { type = "fixed", @@ -175,7 +182,10 @@ minetest.register_node("df_farming:plump_helmet_3", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", + sounds = default.node_sound_leaves_defaults(), + sound = {eat = {name = "df_farming_gummy_chew", gain = 1.0}}, walkable = false, + is_ground_content = false, floodable = true, node_box = { type = "fixed", @@ -208,7 +218,10 @@ minetest.register_node("df_farming:plump_helmet_4", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", + sounds = default.node_sound_leaves_defaults(), + sound = {eat = {name = "df_farming_gummy_chew", gain = 1.0}}, walkable = false, + is_ground_content = false, floodable = false, -- I figure full grown plump helmets are sturdy enough to survive inundation node_box = { type = "fixed", @@ -260,7 +273,10 @@ minetest.register_node("df_farming:plump_helmet_4_picked", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", + sounds = default.node_sound_leaves_defaults(), + sound = {eat = {name = "df_farming_gummy_chew", gain = 1.0}}, walkable = false, + is_ground_content = false, floodable = false, node_box = { type = "fixed", diff --git a/df_farming/quarry_bush.lua b/df_farming/quarry_bush.lua index 11cd7cd..b5db3e2 100644 --- a/df_farming/quarry_bush.lua +++ b/df_farming/quarry_bush.lua @@ -18,9 +18,16 @@ local register_quarry_bush = function(number) paramtype = "light", walkable = false, buildable_to = true, + is_ground_content = false, floodable = true, groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11}, sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { + {-8/16, -8/16, -8/16, 8/16, -8/16 + (16/5)*number/16, 8/16}, + }, + }, on_timer = function(pos, elapsed) df_farming.grow_underground_plant(pos, name, elapsed) diff --git a/df_farming/settingtypes.txt b/df_farming/settingtypes.txt index 73e63de..213c576 100644 --- a/df_farming/settingtypes.txt +++ b/df_farming/settingtypes.txt @@ -1,4 +1,4 @@ -dfcaverns_plant_growth_time (Base plant growth timer interval) int 100 +dfcaverns_plant_growth_time (Base plant growth timer interval) int 3600 dfcaverns_cave_wheat_delay_multiplier (cave_wheat growth delay multiplier) float 1 dfcaverns_dimple_cup_delay_multiplier (dimple_cup growth delay multiplier) float 3 dfcaverns_pig_tail_delay_multiplier (pig_tail growth delay multiplier) float 1 diff --git a/df_farming/sounds/df_farming_chomp_crunch.1.ogg b/df_farming/sounds/df_farming_chomp_crunch.1.ogg new file mode 100644 index 0000000..08495c0 Binary files /dev/null and b/df_farming/sounds/df_farming_chomp_crunch.1.ogg differ diff --git a/df_farming/sounds/df_farming_chomp_crunch.2.ogg b/df_farming/sounds/df_farming_chomp_crunch.2.ogg new file mode 100644 index 0000000..988a885 Binary files /dev/null and b/df_farming/sounds/df_farming_chomp_crunch.2.ogg differ diff --git a/df_farming/sounds/df_farming_chomp_crunch.3.ogg b/df_farming/sounds/df_farming_chomp_crunch.3.ogg new file mode 100644 index 0000000..49a6bc2 Binary files /dev/null and b/df_farming/sounds/df_farming_chomp_crunch.3.ogg differ diff --git a/df_farming/sounds/df_farming_chomp_crunch.4.ogg b/df_farming/sounds/df_farming_chomp_crunch.4.ogg new file mode 100644 index 0000000..06c455d Binary files /dev/null and b/df_farming/sounds/df_farming_chomp_crunch.4.ogg differ diff --git a/df_farming/sounds/df_farming_crisp_chew.1.ogg b/df_farming/sounds/df_farming_crisp_chew.1.ogg new file mode 100644 index 0000000..095b6b9 Binary files /dev/null and b/df_farming/sounds/df_farming_crisp_chew.1.ogg differ diff --git a/df_farming/sounds/df_farming_crisp_chew.2.ogg b/df_farming/sounds/df_farming_crisp_chew.2.ogg new file mode 100644 index 0000000..ff5748d Binary files /dev/null and b/df_farming/sounds/df_farming_crisp_chew.2.ogg differ diff --git a/df_farming/sounds/df_farming_gummy_chew.1.ogg b/df_farming/sounds/df_farming_gummy_chew.1.ogg new file mode 100644 index 0000000..abe0f57 Binary files /dev/null and b/df_farming/sounds/df_farming_gummy_chew.1.ogg differ diff --git a/df_farming/sounds/df_farming_gummy_chew.2.ogg b/df_farming/sounds/df_farming_gummy_chew.2.ogg new file mode 100644 index 0000000..fbbbf1f Binary files /dev/null and b/df_farming/sounds/df_farming_gummy_chew.2.ogg differ diff --git a/df_farming/sounds/df_farming_gummy_chew.3.ogg b/df_farming/sounds/df_farming_gummy_chew.3.ogg new file mode 100644 index 0000000..9409d07 Binary files /dev/null and b/df_farming/sounds/df_farming_gummy_chew.3.ogg differ diff --git a/df_farming/sounds/df_farming_mushy_chew.1.ogg b/df_farming/sounds/df_farming_mushy_chew.1.ogg new file mode 100644 index 0000000..20c0153 Binary files /dev/null and b/df_farming/sounds/df_farming_mushy_chew.1.ogg differ diff --git a/df_farming/sounds/df_farming_mushy_chew.2.ogg b/df_farming/sounds/df_farming_mushy_chew.2.ogg new file mode 100644 index 0000000..140dcef Binary files /dev/null and b/df_farming/sounds/df_farming_mushy_chew.2.ogg differ diff --git a/df_farming/sounds/df_farming_mushy_chew.3.ogg b/df_farming/sounds/df_farming_mushy_chew.3.ogg new file mode 100644 index 0000000..be3cb35 Binary files /dev/null and b/df_farming/sounds/df_farming_mushy_chew.3.ogg differ diff --git a/df_farming/sounds/df_farming_soft_chew.1.ogg b/df_farming/sounds/df_farming_soft_chew.1.ogg new file mode 100644 index 0000000..f85b83a Binary files /dev/null and b/df_farming/sounds/df_farming_soft_chew.1.ogg differ diff --git a/df_farming/sounds/df_farming_soft_chew.2.ogg b/df_farming/sounds/df_farming_soft_chew.2.ogg new file mode 100644 index 0000000..52f868e Binary files /dev/null and b/df_farming/sounds/df_farming_soft_chew.2.ogg differ diff --git a/df_farming/sounds/df_farming_soft_chew.3.ogg b/df_farming/sounds/df_farming_soft_chew.3.ogg new file mode 100644 index 0000000..48ed908 Binary files /dev/null and b/df_farming/sounds/df_farming_soft_chew.3.ogg differ diff --git a/df_farming/sounds/df_farming_soft_chew.4.ogg b/df_farming/sounds/df_farming_soft_chew.4.ogg new file mode 100644 index 0000000..bcc8cf8 Binary files /dev/null and b/df_farming/sounds/df_farming_soft_chew.4.ogg differ diff --git a/df_farming/sounds/license.txt b/df_farming/sounds/license.txt new file mode 100644 index 0000000..a667e3f --- /dev/null +++ b/df_farming/sounds/license.txt @@ -0,0 +1,5 @@ +df_farming_gummy_chew 1,2 and 3 are from https://freesound.org/people/Breviceps/sounds/447916/ by Breviceps under the CC0 public domain license +df_farming_chomp_crunch are from https://freesound.org/people/bbrocer/sounds/382650/ by bbrocer under the CC0 public domain license +df_farming_crisp_chew 1 and 2 are from https://freesound.org/people/InspectorJ/sounds/412068/ by InspectorJ under the CC-BY-SA 3.0 license +df_farming_soft_chew 1, 2, 3 and 4 are from https://freesound.org/people/miekyj/sounds/326464/ by miekyj under the CC0 public domain license +df_farming_mushy_chew 1, 2 and 3 are from https://freesound.org/people/nickyg11p/sounds/390800/ by nickyg11p under the CC0 public domain license \ No newline at end of file diff --git a/df_farming/sweet_pod.lua b/df_farming/sweet_pod.lua index 6516c5a..a1c2818 100644 --- a/df_farming/sweet_pod.lua +++ b/df_farming/sweet_pod.lua @@ -15,10 +15,17 @@ local register_sweet_pod = function(number) inventory_image = "dfcaverns_sweet_pod_"..tostring(number)..".png", paramtype = "light", walkable = false, + is_ground_content = false, buildable_to = true, floodable = true, groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11}, sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { + {-8/16, -8/16, -8/16, 8/16, -8/16 + (16/6)*number/16, 8/16}, + }, + }, on_timer = function(pos, elapsed) df_farming.grow_underground_plant(pos, name, elapsed) diff --git a/df_farming/textures/dfcaverns_cave_straw.png b/df_farming/textures/dfcaverns_cave_straw.png new file mode 100644 index 0000000..9b97007 Binary files /dev/null and b/df_farming/textures/dfcaverns_cave_straw.png differ diff --git a/df_farming/textures/dfcaverns_cave_wheat_flattened.png b/df_farming/textures/dfcaverns_cave_wheat_flattened.png new file mode 100644 index 0000000..83e3274 Binary files /dev/null and b/df_farming/textures/dfcaverns_cave_wheat_flattened.png differ diff --git a/df_farming/textures/dfcaverns_pig_tail_flattened.png b/df_farming/textures/dfcaverns_pig_tail_flattened.png new file mode 100644 index 0000000..b51f8aa Binary files /dev/null and b/df_farming/textures/dfcaverns_pig_tail_flattened.png differ diff --git a/df_farming/textures/license.txt b/df_farming/textures/license.txt index bcdea20..6607818 100644 --- a/df_farming/textures/license.txt +++ b/df_farming/textures/license.txt @@ -4,12 +4,19 @@ dfcaverns_dwarven_syrup_source_animated - derived from default dfcaverns_dwarven_syrup - derived from default dfcaverns_dwarven_syrup_flowing_animated - derived from default dfcaverns_fungi - copied from caverealms + +Farming textures are released under CC Attribution 3.0 Unported (CC BY 3.0) and list the following authors: +Copyright (C) 2012-2016 PilzAdam +Copyright (C) 2014-2016 BlockMen +Copyright (C) 2015-2016 MasterGollum +Copyright (C) 2015-2016 Gambit dfcaverns_cave_wheat - derived from farming wheat +dfcaverns_cave_straw - derived from farming straw dfcaverns_flour - derived from farming dfcaverns_bread - derived from farming dfcaverns_pig_tail_thread - copied from farming dfcaverns_sugar - derived from farming -dfcaverns_cave_wheat_seed, dfcaverns_pig_tail_seed - all derived from farming wheat seed +dfcaverns_cave_wheat_seed, dfcaverns_pig_tail_seed - derived from farming wheat seed diff --git a/df_mapitems/castle_coral.lua b/df_mapitems/castle_coral.lua index 86b661c..9283c65 100644 --- a/df_mapitems/castle_coral.lua +++ b/df_mapitems/castle_coral.lua @@ -13,6 +13,7 @@ minetest.register_node("df_mapitems:castle_coral", { _doc_items_longdesc = df_mapitems.doc.castle_coral_desc, _doc_items_usagehelp = df_mapitems.doc.castle_coral_usage, drawtype = "mesh", + is_ground_content = false, light_source = 2, mesh = "octagonal_coral.obj", drop = "df_mapitems:castle_coral_skeleton", @@ -34,6 +35,7 @@ minetest.register_node("df_mapitems:castle_coral_skeleton", { drawtype = "mesh", mesh = "octagonal_coral.obj", paramtype = "light", + is_ground_content = false, groups = {cracky = 3}, sounds = default.node_sound_stone_defaults(), }) diff --git a/df_mapitems/cave_coral.lua b/df_mapitems/cave_coral.lua index 9a38c80..b90a917 100644 --- a/df_mapitems/cave_coral.lua +++ b/df_mapitems/cave_coral.lua @@ -10,8 +10,14 @@ minetest.register_node("df_mapitems:cave_coral_3", { drop = "default:coral_skeleton", light_source = 3, paramtype2 = "facedir", + is_ground_content = false, groups = {cracky = 3, dfcaverns_cave_coral = 1}, sounds = default.node_sound_stone_defaults(), + on_timer = function(pos) + if minetest.find_node_near(pos, 1, {"default:water_source"}) == nil then + minetest.set_node(pos, {name="default:coral_skeleton"}) + end + end, }) minetest.register_node("df_mapitems:cave_coral_2", { @@ -22,8 +28,14 @@ minetest.register_node("df_mapitems:cave_coral_2", { drop = "default:coral_skeleton", light_source = 2, paramtype2 = "facedir", + is_ground_content = false, groups = {cracky = 3, dfcaverns_cave_coral = 1}, sounds = default.node_sound_stone_defaults(), + on_timer = function(pos) + if minetest.find_node_near(pos, 1, {"default:water_source"}) == nil then + minetest.set_node(pos, {name="default:coral_skeleton"}) + end + end, }) minetest.register_node("df_mapitems:cave_coral_1", { @@ -34,8 +46,14 @@ minetest.register_node("df_mapitems:cave_coral_1", { drop = "default:coral_skeleton", light_source = 1, paramtype2 = "facedir", + is_ground_content = false, groups = {cracky = 3, dfcaverns_cave_coral = 1}, sounds = default.node_sound_stone_defaults(), + on_timer = function(pos) + if minetest.find_node_near(pos, 1, {"default:water_source"}) == nil then + minetest.set_node(pos, {name="default:coral_skeleton"}) + end + end, }) local coral_names = {"df_mapitems:cave_coral_1", "df_mapitems:cave_coral_2", "df_mapitems:cave_coral_3"} diff --git a/df_mapitems/cave_pearls.lua b/df_mapitems/cave_pearls.lua index 2d4b4ee..098d358 100644 --- a/df_mapitems/cave_pearls.lua +++ b/df_mapitems/cave_pearls.lua @@ -12,6 +12,7 @@ minetest.register_node("df_mapitems:cave_pearls", { paramtype2 = "facedir", groups = {cracky = 2}, walkable = false, + is_ground_content = false, climbable = true, light_source = 4, node_box = { diff --git a/df_mapitems/config.lua b/df_mapitems/config.lua index e93a6d6..5ebf388 100644 --- a/df_mapitems/config.lua +++ b/df_mapitems/config.lua @@ -7,11 +7,11 @@ local print_settingtypes = false local function setting(stype, name, default, description) local value if stype == "bool" then - value = minetest.setting_getbool(CONFIG_FILE_PREFIX..name) + value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name, default) elseif stype == "string" then - value = minetest.setting_get(CONFIG_FILE_PREFIX..name) + value = minetest.settings:get(CONFIG_FILE_PREFIX..name) elseif stype == "int" or stype == "float" then - value = tonumber(minetest.setting_get(CONFIG_FILE_PREFIX..name)) + value = tonumber(minetest.settings:get(CONFIG_FILE_PREFIX..name)) end if value == nil then value = default diff --git a/df_mapitems/crystals_mese.lua b/df_mapitems/crystals_mese.lua index b44f48e..282c666 100644 --- a/df_mapitems/crystals_mese.lua +++ b/df_mapitems/crystals_mese.lua @@ -8,9 +8,9 @@ minetest.register_node("df_mapitems:glow_mese", { _doc_items_longdesc = df_mapitems.doc.glow_mese_desc, _doc_items_usagehelp = df_mapitems.doc.glow_mese_usage, tiles = {"dfcaverns_glow_mese.png"}, - is_ground_content = true, groups = {cracky=3}, sounds = default.node_sound_glass_defaults(), + is_ground_content = false, light_source = 13, paramtype = "light", use_texture_alpha = true, @@ -36,7 +36,7 @@ minetest.register_node("df_mapitems:mese_crystal", { drawtype = "mesh", mesh = "underch_crystal.obj", light_source = 12, - is_ground_content = true, + is_ground_content = false, sounds = default.node_sound_glass_defaults(), use_texture_alpha = true, sunlight_propagates = true, diff --git a/df_mapitems/crystals_ruby.lua b/df_mapitems/crystals_ruby.lua index 3ee6435..9b298bf 100644 --- a/df_mapitems/crystals_ruby.lua +++ b/df_mapitems/crystals_ruby.lua @@ -7,7 +7,7 @@ minetest.register_node("df_mapitems:glow_ruby_ore", { _doc_items_longdesc = df_mapitems.doc.glow_ruby_ore_desc, _doc_items_usagehelp = df_mapitems.doc.glow_ruby_ore_usage, tiles = {"dfcaverns_glow_ruby_ore.png"}, - is_ground_content = true, + is_ground_content = false, groups = {cracky=2}, sounds = default.node_sound_glass_defaults(), }) @@ -25,6 +25,7 @@ minetest.register_node("df_mapitems:big_crystal", { use_texture_alpha = true, paramtype = "light", paramtype2 = "facedir", + is_ground_content = false, sunlight_propagates = true, light_source = 12, groups = {cracky=2, dfcaverns_big_crystal = 1}, @@ -52,6 +53,7 @@ minetest.register_node("df_mapitems:med_crystal", { use_texture_alpha = true, paramtype = "light", paramtype2 = "facedir", + is_ground_content = false, sunlight_propagates = true, light_source = 12, groups = {cracky=2, dfcaverns_big_crystal = 1}, @@ -81,6 +83,7 @@ minetest.register_node("df_mapitems:big_crystal_30", { paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, + is_ground_content = false, light_source = 12, drop = "df_mapitems:big_crystal", groups = {cracky=2, dfcaverns_big_crystal = 1}, @@ -132,6 +135,7 @@ minetest.register_node("df_mapitems:med_crystal_30", { paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, + is_ground_content = false, light_source = 12, drop = "df_mapitems:med_crystal", groups = {cracky=2, dfcaverns_big_crystal = 1}, @@ -168,6 +172,7 @@ minetest.register_node("df_mapitems:big_crystal_30_45", { paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, + is_ground_content = false, light_source = 12, drop = "df_mapitems:big_crystal", groups = {cracky=2, dfcaverns_big_crystal = 1}, @@ -205,6 +210,7 @@ minetest.register_node("df_mapitems:med_crystal_30_45", { paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, + is_ground_content = false, light_source = 12, drop = "df_mapitems:med_crystal", groups = {cracky=2, dfcaverns_big_crystal = 1}, diff --git a/df_mapitems/crystals_salt.lua b/df_mapitems/crystals_salt.lua index b85878f..fef994a 100644 --- a/df_mapitems/crystals_salt.lua +++ b/df_mapitems/crystals_salt.lua @@ -16,6 +16,7 @@ minetest.register_node("df_mapitems:salt_crystal", { sounds = default.node_sound_glass_defaults(), use_texture_alpha = true, sunlight_propagates = true, + is_ground_content = false, on_place = df_mapitems.place_against_surface, }) @@ -26,7 +27,7 @@ minetest.register_node("df_mapitems:salty_cobble", { tiles = {"default_cobble.png^dfcaverns_salty.png"}, groups = {cracky = 3, stone = 1, lava_heatable = 1}, _magma_conduits_heats_to = "default:cobble", - is_ground_content = true, + is_ground_content = false, light_source = 2, drop = 'default:cobble', sounds = default.node_sound_stone_defaults(), diff --git a/df_mapitems/depends.txt b/df_mapitems/depends.txt deleted file mode 100644 index 77566a3..0000000 --- a/df_mapitems/depends.txt +++ /dev/null @@ -1,7 +0,0 @@ -default -subterrane -df_farming? -farming? -intllib? -doc? -radiant_damage? \ No newline at end of file diff --git a/df_mapitems/description.txt b/df_mapitems/description.txt deleted file mode 100644 index 1bcb512..0000000 --- a/df_mapitems/description.txt +++ /dev/null @@ -1 +0,0 @@ -Various node types used by the dfcaverns mapgen mod. Includes cave coral, flowstone, glowing crystals, glow worms, moss and fungi ground cover, and snare weed. \ No newline at end of file diff --git a/df_mapitems/flowstone.lua b/df_mapitems/flowstone.lua index 1215ff3..5862719 100644 --- a/df_mapitems/flowstone.lua +++ b/df_mapitems/flowstone.lua @@ -13,6 +13,7 @@ df_mapitems.dry_stalagmite_ids = subterrane.register_stalagmite_nodes("df_mapite }, groups = {cracky = 3, stone = 2}, sounds = default.node_sound_stone_defaults(), + is_ground_content = false, }) minetest.register_node("df_mapitems:dry_flowstone", { @@ -22,7 +23,7 @@ minetest.register_node("df_mapitems:dry_flowstone", { tiles = {"default_stone.png^[brighten"}, groups = {cracky = 3, stone = 1, lava_heatable = 1}, _magma_conduits_heats_to = "default:cobble", - is_ground_content = true, + is_ground_content = false, drop = 'default:cobble', sounds = default.node_sound_stone_defaults(), }) @@ -38,6 +39,7 @@ df_mapitems.wet_stalagmite_ids = subterrane.register_stalagmite_nodes("df_mapite }, groups = {cracky = 3, stone = 2, subterrane_wet_dripstone = 1}, sounds = default.node_sound_stone_defaults(), + is_ground_content = false, }, "df_mapitems:dry_stal") @@ -48,7 +50,7 @@ minetest.register_node("df_mapitems:wet_flowstone", { tiles = {"default_stone.png^[brighten^dfcaverns_dripstone_streaks.png"}, groups = {cracky = 3, stone = 1, subterrane_wet_dripstone = 1, lava_heatable = 1}, _magma_conduits_heats_to = "df_mapitems:dry_flowstone", - is_ground_content = true, + is_ground_content = false, drop = 'default:cobble', sounds = default.node_sound_stone_defaults(), }) diff --git a/df_mapitems/glow_worms.lua b/df_mapitems/glow_worms.lua index a31f590..92ee91f 100644 --- a/df_mapitems/glow_worms.lua +++ b/df_mapitems/glow_worms.lua @@ -24,7 +24,7 @@ minetest.register_node("df_mapitems:glow_worm", { }, inventory_image = "dfcaverns_glow_worm.png", wield_image = "dfcaverns_glow_worm.png", - is_ground_content = true, + is_ground_content = false, groups = {oddly_breakable_by_hand=3, light_sensitive_fungus = 12}, _dfcaverns_dead_node = "air", light_source = 9, diff --git a/df_mapitems/ground_cover.lua b/df_mapitems/ground_cover.lua index 61c0e65..902fae6 100644 --- a/df_mapitems/ground_cover.lua +++ b/df_mapitems/ground_cover.lua @@ -8,14 +8,14 @@ local S, NS = dofile(MP.."/intllib.lua") -- cyan/dark cyan minetest.register_node("df_mapitems:dirt_with_cave_moss", { - description = S("Dirt With Cave Moss"), + description = S("Dirt with Cave Moss"), _doc_items_longdesc = df_mapitems.doc.cave_moss_desc, _doc_items_usagehelp = df_mapitems.doc.cave_moss_usage, tiles = {"default_dirt.png^dfcaverns_cave_moss.png", "default_dirt.png", {name = "default_dirt.png^dfcaverns_cave_moss_side.png", tileable_vertical = false}}, drop = "default:dirt", - is_ground_content = true, + is_ground_content = false, light_source = 2, paramtype = "light", groups = {crumbly = 3, soil = 1, light_sensitive_fungus = 8}, @@ -45,18 +45,31 @@ minetest.register_abm{ end, } +if minetest.get_modpath("trail") and trail and trail.register_trample_node then + local HARDPACK_PROBABILITY = minetest.settings:get("trail_hardpack_probability") or 0.5 -- Chance walked dirt/grass is worn and compacted to trail:trail. + local HARDPACK_COUNT = minetest.settings:get("trail_hardpack_count") or 5 -- Number of times the above chance needs to be passed for soil to compact. + + trail.register_trample_node("df_mapitems:dirt_with_cave_moss", { + trampled_node_def_override = {description = S("Dirt with Cave Moss and Footprint"),}, + hard_pack_node_name = "trail:trail", + footprint_opacity = 128, + hard_pack_probability = HARDPACK_PROBABILITY, + hard_pack_count = HARDPACK_COUNT, + }) +end + -------------------------------------------------- -- floor fungus -- white/yellow minetest.register_node("df_mapitems:cobble_with_floor_fungus", { - description = S("Cobblestone With Floor Fungus"), + description = S("Cobblestone with Floor Fungus"), _doc_items_longdesc = df_mapitems.doc.floor_fungus_desc, _doc_items_usagehelp = df_mapitems.doc.floor_fungus_usage, tiles = {"default_cobble.png^dfcaverns_floor_fungus.png"}, drops = "default:cobble", - is_ground_content = true, + is_ground_content = false, paramtype = "light", groups = {cracky = 3, stone = 2, slippery = 1, light_sensitive_fungus = 8}, _dfcaverns_dead_node = "default:cobble", @@ -66,12 +79,12 @@ minetest.register_node("df_mapitems:cobble_with_floor_fungus", { }) minetest.register_node("df_mapitems:cobble_with_floor_fungus_fine", { - description = S("Cobblestone With Floor Fungus"), + description = S("Cobblestone with Floor Fungus"), _doc_items_longdesc = df_mapitems.doc.floor_fungus_desc, _doc_items_usagehelp = df_mapitems.doc.floor_fungus_usage, tiles = {"default_cobble.png^dfcaverns_floor_fungus_fine.png"}, drops = "default:cobble", - is_ground_content = true, + is_ground_content = false, paramtype = "light", groups = {cracky = 3, stone = 2, slippery = 1, light_sensitive_fungus = 8}, _dfcaverns_dead_node = "default:cobble", @@ -106,13 +119,14 @@ minetest.register_abm{ -- Hoar moss minetest.register_node("df_mapitems:ice_with_hoar_moss", { - description = S("Ice With Hoar Moss"), + description = S("Ice with Hoar Moss"), _doc_items_longdesc = df_mapitems.doc.hoar_moss_desc, _doc_items_usagehelp = df_mapitems.doc.hoar_moss_usage, tiles = {"default_ice.png^dfcaverns_hoar_moss.png"}, drops = "default:ice", paramtype = "light", light_source = 2, + is_ground_content = false, groups = {cracky = 3, puts_out_fire = 1, cools_lava = 1, slippery = 2, light_sensitive_fungus = 8}, sounds = default.node_sound_glass_defaults(), _dfcaverns_dead_node = "default:ice", diff --git a/df_mapitems/mod.conf b/df_mapitems/mod.conf index d18cf0e..c763ff3 100644 --- a/df_mapitems/mod.conf +++ b/df_mapitems/mod.conf @@ -1,4 +1,4 @@ name = df_mapitems description = Various node types used by the dfcaverns mapgen mod. Includes cave coral, flowstone, glowing crystals, glow worms, moss and fungi ground cover, and snare weed. depends = default, subterrane -optional_depends = df_farming, farming, intllib, doc, radiant_damage \ No newline at end of file +optional_depends = df_farming, farming, intllib, doc, radiant_damage, trail \ No newline at end of file diff --git a/df_mapitems/snareweed.lua b/df_mapitems/snareweed.lua index c2ec06e..0efeb8a 100644 --- a/df_mapitems/snareweed.lua +++ b/df_mapitems/snareweed.lua @@ -10,7 +10,7 @@ minetest.register_node("df_mapitems:snareweed", { drawtype="plantlike_rooted", paramtype2 = "leveled", special_tiles = {{name = "dfcaverns_snareweed.png", tileable_vertical = true}}, - is_ground_content = true, + is_ground_content = false, drop = 'default:dirt', light_source = 6, groups = {crumbly = 3, soil = 1}, @@ -25,7 +25,7 @@ if df_mapitems.config.snareweed_damage then if timer >= 1 then timer = timer - 1 for _, player in pairs(minetest.get_connected_players()) do - local player_pos = player:getpos() -- node player's feet are in this location. + local player_pos = player:get_pos() -- node player's feet are in this location. local rounded_pos = vector.round(player_pos) local nearby_nodes = minetest.find_nodes_in_area(vector.add(rounded_pos, {x=0, y= -8, z=0}), rounded_pos, {"df_mapitems:snareweed"}) for _, node_pos in ipairs(nearby_nodes) do diff --git a/df_mapitems/textures/dfcaverns_castle_coral.png b/df_mapitems/textures/dfcaverns_castle_coral.png index 1b3a2f0..76328d5 100644 Binary files a/df_mapitems/textures/dfcaverns_castle_coral.png and b/df_mapitems/textures/dfcaverns_castle_coral.png differ diff --git a/df_mapitems/util.lua b/df_mapitems/util.lua index ea876c3..3867e01 100644 --- a/df_mapitems/util.lua +++ b/df_mapitems/util.lua @@ -59,7 +59,7 @@ df_mapitems.place_against_surface = function(itemstack, placer, pointed_thing) end -- add the node and remove 1 item from the itemstack minetest.add_node(above_pos, {name = itemstack:get_name(), param2 = param2}) - if not minetest.setting_getbool("creative_mode") and not minetest.check_player_privs(placer, "creative") then + if not minetest.settings:get_bool("creative_mode", false) and not minetest.check_player_privs(placer, "creative") then itemstack:take_item() end return itemstack diff --git a/df_mapitems/veinstone.lua b/df_mapitems/veinstone.lua index 27633c4..a55f101 100644 --- a/df_mapitems/veinstone.lua +++ b/df_mapitems/veinstone.lua @@ -9,7 +9,7 @@ minetest.register_node("df_mapitems:veinstone", { tiles = {"default_stone.png^dfcaverns_veins.png"}, groups = {cracky = 3, stone = 1, lava_heatable = 1}, _magma_conduits_heats_to = "default:cobble", - is_ground_content = true, + is_ground_content = false, light_source = 2, drop = 'default:cobble', sounds = default.node_sound_stone_defaults(), diff --git a/df_primordial_items/ceiling_fungus.lua b/df_primordial_items/ceiling_fungus.lua new file mode 100644 index 0000000..8dd4994 --- /dev/null +++ b/df_primordial_items/ceiling_fungus.lua @@ -0,0 +1,113 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + +--------------------------------------------------------------------------------------- +-- Glownode and stalk + +minetest.register_node("df_primordial_items:glownode", { + description = S("Primordial Fungal Lantern"), + _doc_items_longdesc = df_primordial_items.doc.glownode_desc, + _doc_items_usagehelp = df_primordial_items.doc.glownode_usage, + drawtype = "glasslike", + tiles = {"dfcaverns_mush_glownode.png"}, + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + groups = {cracky = 3, oddly_breakable_by_hand = 3}, + sounds = default.node_sound_glass_defaults(), + light_source = default.LIGHT_MAX, +}) + +minetest.register_node("df_primordial_items:glownode_stalk", { + description = S("Primordial Fungal Lantern Stalk"), + _doc_items_longdesc = df_primordial_items.doc.glownode_stalk_desc, + _doc_items_usagehelp = df_primordial_items.doc.glownode_stalk_usage, + tiles = {"dfcaverns_mush_stalk_top.png", "dfcaverns_mush_stalk_top.png", "dfcaverns_mush_stalk_side.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node +}) + +minetest.register_node("df_primordial_items:glow_orb_hanging", { + description = S("Primordial Fungal Orb"), + _doc_items_longdesc = df_primordial_items.doc.glow_orb_desc, + _doc_items_usagehelp = df_primordial_items.doc.glow_orb_usage, + tiles = {"dfcaverns_mush_orb_vert.png"}, + inventory_image = "dfcaverns_mush_orb_vert.png", + wield_image = "dfcaverns_mush_orb_vert.png", + groups = {snappy = 3, flora = 1, flammable = 1}, + paramtype = "light", + paramtype2 = "degrotate", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + light_source = 6, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +local c_stalk = minetest.get_content_id("df_primordial_items:glownode_stalk") +local c_node = minetest.get_content_id("df_primordial_items:glownode") +local c_air = minetest.get_content_id("air") + +df_primordial_items.spawn_ceiling_spire_vm = function(vi, area, data) + local spire_height = math.random(1,10) + + local ystride = area.ystride + local zstride = area.zstride + + for i = 0, spire_height do + if data[vi-i*ystride] == c_air then + data[vi-i*ystride] = c_stalk + end + end + local bottom = vi - (spire_height +1) * ystride + if data[bottom] == c_air then + data[bottom] = c_node + end + + if spire_height > 4 then -- thicken it all up + for i = 0, math.floor(spire_height/2) do + local current_vi = vi-i*ystride + if data[current_vi+1] == c_air then + data[current_vi+1] = c_stalk + end + if data[current_vi-1] == c_air then + data[current_vi-1] = c_stalk + end + if data[current_vi+zstride] == c_air then + data[current_vi+zstride] = c_stalk + end + if data[current_vi-zstride] == c_air then + data[current_vi-zstride] = c_stalk + end + end + + if spire_height > 7 then + bottom = bottom-ystride + if data[bottom] == c_air then + data[bottom] = c_node + end + if data[bottom-ystride] == c_air then + data[bottom-ystride] = c_node + end + if data[bottom+1] == c_air then + data[bottom+1] = c_node + end + if data[bottom-1] == c_air then + data[bottom-1] = c_node + end + if data[bottom+zstride] == c_air then + data[bottom+zstride] = c_node + end + if data[bottom-zstride] == c_air then + data[bottom-zstride] = c_node + end + end + end +end \ No newline at end of file diff --git a/df_primordial_items/doc.lua b/df_primordial_items/doc.lua new file mode 100644 index 0000000..77d722b --- /dev/null +++ b/df_primordial_items/doc.lua @@ -0,0 +1,72 @@ +if not minetest.get_modpath("doc") then + return +end + +df_primordial_items.doc.big_mushroom_desc = S("Compared to the behemoths found elsewhere in the deep places of the world, the giant mushrooms of the primordial jungles are on the smaller side - often overwhelmed by the green plants that grow in the mysterious light below. Still, they can become substantial resources.") +df_primordial_items.doc.big_mushroom_usage = S("The soft flesh of these large mushrooms is much less woody than other giant mushrooms, making it ill-suited to structural use. This makes it rather more nutritious, however.") + +df_primordial_items.doc.dirt_with_jungle_grass_desc = S("The soil of the primordial jungle is rife with strange life at every scale.") +df_primordial_items.doc.dirt_with_jungle_grass_usage = S("When left uncultivated primordial jungle soil will sprout all manner of strange wild plants.") +df_primordial_items.doc.dirt_with_mycelium_desc = S("Fungal fibers have infiltrated the ground in a spongy mass, making the soil half mineral and half living matter.") +df_primordial_items.doc.dirt_with_mycelium_usage = S("When left uncultivated mycelial soil will sprout all manner of strange wild fungi.") + +df_primordial_items.doc.fern_desc = S("The dark-leaved ferns of the primordial jungle harken back to an earlier era of life in the world.") +--df_primordial_items.doc.fern_usage = S("") +df_primordial_items.doc.grass_desc = S("These fibrous plants that grow in the deep appear similar to grass at a glance, but they are more closely related to horsetails - a form of vegetation from before the advent of modern plant forms. Ironically, pale cave wheat is more kin to surface grass than this is.") +--df_primordial_items.doc.grass_usage = S("") + +df_primordial_items.doc.ivy_desc = S("Tangled weaves of ivy hang from the ceiling where there are wide enough gaps between the bright sources of light.") +df_primordial_items.doc.ivy_usage = S("Ivy is climbable, if it hangs close enough to the ground it can serve as a path between floor and ceiling.") +df_primordial_items.doc.roots_desc = S("Somewhere above an enormous plant has wedged its roots down through the rock and emerged from the ceiling of another cavern.") +df_primordial_items.doc.roots_usage = S("These hanging roots are climbable.") + +df_primordial_items.doc.fungal_grass_desc = S("Questing fibers of fungal mycelium sometimes erupt from the soil and reach upward, driven by chemical cues to seek out nourishment above. They look a lot like white grass, at a glance.") +--df_primordial_items.doc.fungal_grass_usage = S("") + +df_primordial_items.doc.tree_desc = S("The large woody plants of the primordial jungle are similar in appearance to the jungle trees of the surface, but are a result of convergent evolution from ancient cycad plants toward a common form.") +df_primordial_items.doc.tree_usage = S("Like wood of the surface world, primordial jungle trees can be chopped and carved as building material or as fuel.") +df_primordial_items.doc.tree_glowing_desc = S("The cracks in the bark of some primordial jungle trees become host to phosphorescent veins of symbiotic fungus.") +df_primordial_items.doc.tree_glowing_usage = S("The glowing bark fungus doesn't extend into the wood of the trunk, resulting in surprisingly mundane building material when hewn.") +--df_primordial_items.doc.leaves_desc = S("") +--df_primordial_items.doc.leaves_usage = S("") +df_primordial_items.doc.glowing_leaves_desc = S("Some fronds of primordial jungle trees also become host to the phosphorescent fungus that creeps through cracks in the bark.") +--df_primordial_items.doc.glowing_leaves_usage = S("") + +df_primordial_items.doc.giant_fern_desc = S("The still air of these ancient caverns have allowed ferns to grow to prodigious sizes, where storms and rain would normally tear their weaker fronds off on the surface of the world.") +df_primordial_items.doc.giant_fern_usage = S("When a fern grows to such sizes its stem becomes dense enough to be used as a form of wood.") + +df_primordial_items.doc.giant_hyphae_desc = S("Fungus in its purest form, these gigantic rope-like hyphae creep over the surface of soil and burrow in to feed wherever nutrients are sensed.") +df_primordial_items.doc.giant_hyphae_usage = S("Much like a rope, hyphae have fibers inside that can be unraveled and used for a variety of crafts.") +df_primordial_items.doc.mycelial_fibers_desc = S("Fibers extracted from gigantic fungal hyphae.") +--df_primordial_items.doc.mycelial_fibers_usage = S("") +df_primordial_items.doc.mycelial_thread_desc = df_primordial_items.doc.mycelial_fibers_desc +--df_primordial_items.doc.mycelial_thread_usage = S("") + +df_primordial_items.doc.giant_mushroom_desc = S("The grandest of the great mushroom species can be found in the deepest primordial caverns. Their broad caps have hanging gills.") +df_primordial_items.doc.giant_mushroom_usage = S("Much like the giant mushrooms of higher cavern layers, these can be carved into woody material for use as fuel or for building things. The grain of these primordial mushrooms is knurled.") +--df_primordial_items.doc.gills_desc = S("") +--df_primordial_items.doc.gills_usage = S("") + +--df_primordial_items.doc.glow_orb_desc = S("") +--df_primordial_items.doc.glow_orb_usage = S("") +--df_primordial_items.doc.glow_plant_desc = S("") +--df_primordial_items.doc.glow_plant_usage = S("") +--df_primordial_items.doc.glow_pod_desc = S("") +--df_primordial_items.doc.glow_pod_usage = S("") + +-- The giant hanging fungal structures from the ceiling +--df_primordial_items.doc.glownode_desc = S("") +--df_primordial_items.doc.glownode_usage = S("") +--df_primordial_items.doc.glownode_stalk_desc = S("") +--df_primordial_items.doc.glownode_stalk_usage = S("") + +df_primordial_items.doc.packed_roots_desc = S("The steady light and unchanging growing conditions of the primordial caverns have led to great mountainous masses of plant material growing in particularly fertile spots, hardly identifiable as individual organisms.") +df_primordial_items.doc.packed_roots_usage = S("The gnarled interwoven root-like foundations of this plant material is not useful as building material, but can serve as a fuel source.") +df_primordial_items.doc.plant_matter_desc = df_primordial_items.doc.packed_roots_desc +df_primordial_items.doc.plant_matter_usage = df_primordial_items.doc.packed_roots_usage + +--df_primordial_items.doc.small_mushroom_desc = S("") +--df_primordial_items.doc.small_mushroom_usage = S("") +-- +--df_primordial_items.doc.thorn_desc = S("") +--df_primordial_items.doc.thorn_usage = S("") diff --git a/df_primordial_items/fungal_nodes.lua b/df_primordial_items/fungal_nodes.lua new file mode 100644 index 0000000..050740b --- /dev/null +++ b/df_primordial_items/fungal_nodes.lua @@ -0,0 +1,145 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + +----------------------------------------------------------------------------------------------- +-- Plants + +-- Grass + +minetest.register_node("df_primordial_items:fungal_grass_1", { + description = S("Primordial Fungal Grass"), + _doc_items_longdesc = df_primordial_items.doc.fungal_grass_desc, + _doc_items_usagehelp = df_primordial_items.doc.fungal_grass_usage, + tiles = {"dfcaverns_mush_grass_01.png"}, + inventory_image = "dfcaverns_mush_grass_01.png", + wield_image = "dfcaverns_mush_grass_01.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_fungal_plant = 1, light_sensitive_fungus = 11}, + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +minetest.register_node("df_primordial_items:fungal_grass_2", { + description = S("Primordial Fungal Grass"), + _doc_items_longdesc = df_primordial_items.doc.fungal_grass_desc, + _doc_items_usagehelp = df_primordial_items.doc.fungal_grass_usage, + tiles = {"dfcaverns_mush_grass_02.png"}, + inventory_image = "dfcaverns_mush_grass_02.png", + wield_image = "dfcaverns_mush_grass_02.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_fungal_plant = 1, light_sensitive_fungus = 11}, + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + place_param2 = 3, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +-- Glowing + +minetest.register_node("df_primordial_items:glow_orb", { + description = S("Primordial Fungal Orb"), + _doc_items_longdesc = df_primordial_items.doc.glow_orb_desc, + _doc_items_usagehelp = df_primordial_items.doc.glow_orb_usage, + tiles = {"dfcaverns_mush_orb.png"}, + inventory_image = "dfcaverns_mush_orb.png", + wield_image = "dfcaverns_mush_orb.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_fungal_plant = 1, light_sensitive_fungus = 13}, + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + light_source = 9, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +minetest.register_node("df_primordial_items:glow_orb_stalks", { + description = S("Primordial Fungal Orb"), + _doc_items_longdesc = df_primordial_items.doc.glow_orb_desc, + _doc_items_usagehelp = df_primordial_items.doc.glow_orb_usage, + tiles = {"dfcaverns_mush_stalks.png"}, + inventory_image = "dfcaverns_mush_stalks.png", + wield_image = "dfcaverns_mush_stalks.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_fungal_plant = 1, light_sensitive_fungus = 13}, + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + light_source = 6, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +minetest.register_node("df_primordial_items:glow_pods", { + description = S("Primordial Fungal Pod"), + _doc_items_longdesc = df_primordial_items.doc.glow_pod_desc, + _doc_items_usagehelp = df_primordial_items.doc.glow_pod_usage, + tiles = {"dfcaverns_mush_pods.png"}, + inventory_image = "dfcaverns_mush_pods.png", + wield_image = "dfcaverns_mush_pods.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_fungal_plant = 1, light_sensitive_fungus = 13}, + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + light_source = 6, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +------------------------------------------------------------------------------------ +-- Dirt + +minetest.register_node("df_primordial_items:dirt_with_mycelium", { + description = S("Dirt with Primordial Mycelium"), + _doc_items_longdesc = df_primordial_items.doc.dirt_with_mycelium_desc, + _doc_items_usagehelp = df_primordial_items.doc.dirt_with_mycelium_usage, + tiles = {"dfcaverns_mush_soil.png"}, + groups = {crumbly = 3, soil = 1}, + is_ground_content = false, + paramtype = "light", + drops = "default:dirt", + sounds = default.node_sound_dirt_defaults(), + light_source = 3, +}) + +minetest.register_abm{ + label = "df_primordial_items:dirt_with_mycelium_spread", + nodenames = {"default:dirt"}, + neighbors = {"df_mapitems:dirt_with_mycelium"}, + interval = 60, + chance = 50, + catch_up = true, + action = function(pos) + minetest.swap_node(pos, {name="df_mapitems:dirt_with_mycelium"}) + end, +} + +if minetest.get_modpath("trail") and trail and trail.register_trample_node then + local HARDPACK_PROBABILITY = minetest.settings:get("trail_hardpack_probability") or 0.5 -- Chance walked dirt/grass is worn and compacted to trail:trail. + local HARDPACK_COUNT = minetest.settings:get("trail_hardpack_count") or 5 -- Number of times the above chance needs to be passed for soil to compact. + + trail.register_trample_node("df_primordial_items:dirt_with_mycelium", { + trampled_node_def_override = {description = S("Dirt with Primordial Mycelium and Footprint"),}, + footprint_opacity = 196, + hard_pack_node_name = "trail:trail", + hard_pack_probability = HARDPACK_PROBABILITY, + hard_pack_count = HARDPACK_COUNT, + }) +end diff --git a/df_primordial_items/giant_fern.lua b/df_primordial_items/giant_fern.lua new file mode 100644 index 0000000..fc0cd46 --- /dev/null +++ b/df_primordial_items/giant_fern.lua @@ -0,0 +1,312 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + +------------------------------------------------------------------------------------ +-- Nodes + +minetest.register_node("df_primordial_items:giant_fern_tree", { + description = S("Giant Fern Stem"), + _doc_items_longdesc = df_primordial_items.doc.giant_fern_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_fern_usage, + tiles = {"dfcaverns_jungle_fern_stem.png","dfcaverns_jungle_fern_stem.png","dfcaverns_jungle_fern_bark.png",}, + groups = {tree=1, choppy=2, oddly_breakable_by_hand=1, flammable= 2, fern_stem = 1}, + is_ground_content = false, + paramtype = "light", + paramtype2 = "facedir", + sounds = default.node_sound_wood_defaults(), + sunlight_propagates = true, + on_place = minetest.rotate_node, +}) + +minetest.register_node("df_primordial_items:giant_fern_tree_slant_bottom", { + description = S("Giant Fern Stem"), + _doc_items_longdesc = df_primordial_items.doc.giant_fern_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_fern_usage, + tiles = { + "dfcaverns_jungle_fern_stem.png", + "dfcaverns_jungle_fern_bark.png", + "dfcaverns_jungle_fern_stem.png", + "dfcaverns_jungle_fern_bark.png", + "dfcaverns_jungle_fern_bark.png", + "dfcaverns_jungle_fern_bark.png", + }, + paramtype2 = "facedir", + drawtype = "mesh", + mesh = "dfcaverns_fern_slant.obj", + paramtype = "light", + drop = "df_primordial_items:giant_fern_tree", + groups = {choppy = 2, tree = 1, oddly_breakable_by_hand=1, flammable = 2, fern_stem = 1}, + sounds = default.node_sound_wood_defaults(), + is_ground_content = false, + on_place = minetest.rotate_node, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.625, 0.5, 0.0, 0.375}, + {-0.5, 0.0, -0.875, 0.5, 0.5, 0.125}, + }, + }, + collision_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.625, 0.5, 0.0, 0.375}, + {-0.5, 0.0, -0.875, 0.5, 0.5, 0.125}, + }, + }, +}) + +minetest.register_node("df_primordial_items:giant_fern_tree_slant_top", { + description = S("Giant Fern Stem"), + _doc_items_longdesc = df_primordial_items.doc.giant_fern_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_fern_usage, + tiles = { + "dfcaverns_jungle_fern_stem.png", + "dfcaverns_jungle_fern_bark.png", + "dfcaverns_jungle_fern_stem.png", + "dfcaverns_jungle_fern_bark.png", + "dfcaverns_jungle_fern_bark.png", + "dfcaverns_jungle_fern_bark.png", + }, + paramtype2 = "facedir", + drawtype = "mesh", + mesh = "dfcaverns_fern_slant_2.obj", + paramtype = "light", + drop = "df_primordial_items:giant_fern_tree", + groups = {choppy = 2, tree = 1, oddly_breakable_by_hand=1, flammable = 2, fern_stem = 1}, + sounds = default.node_sound_wood_defaults(), + is_ground_content = false, + on_place = minetest.rotate_node, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.125, 0.5, 0.0, 0.875}, + {-0.5, 0.0, -0.375, 0.5, 0.5, 0.625}, + }, + }, + collision_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.125, 0.5, 0.0, 0.875}, + {-0.5, 0.0, -0.375, 0.5, 0.5, 0.625}, + }, + }, +}) + +minetest.register_node("df_primordial_items:giant_fern_tree_slant_full", { + description = S("Giant Fern Stem"), + _doc_items_longdesc = df_primordial_items.doc.giant_fern_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_fern_usage, + tiles = { + "dfcaverns_jungle_fern_stem.png", + "dfcaverns_jungle_fern_bark.png", + "dfcaverns_jungle_fern_bark.png", + "dfcaverns_jungle_fern_bark.png", + "dfcaverns_jungle_fern_bark.png", + "dfcaverns_jungle_fern_bark.png", + }, + paramtype2 = "facedir", + drawtype = "mesh", + mesh = "dfcaverns_fern_slant_full.obj", + paramtype = "light", + drop = "df_primordial_items:giant_fern_tree", + groups = {choppy = 2, tree = 1, oddly_breakable_by_hand=1, flammable = 2, fern_stem = 1}, + sounds = default.node_sound_wood_defaults(), + is_ground_content = false, + on_place = minetest.rotate_node, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.75, 0.5, 0, 0.25}, + {-0.5, 0, -1.25, 0.5, 0.5, -0.25}, + }, + }, + collision_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.75, 0.5, 0, 0.25}, + {-0.5, 0, -1.25, 0.5, 0.5, -0.25}, + }, + }, +}) + +minetest.register_node("df_primordial_items:fern_wood", { + description = S("Fern Wood"), + _doc_items_longdesc = df_primordial_items.doc.giant_fern_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_fern_usage, + paramtype2 = "facedir", + tiles = {"default_wood.png^[multiply:#10FF10"}, + is_ground_content = false, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_craft({ + output = "df_primordial_items:fern_wood 4", + recipe = { + {"group:fern_stem"}, + } +}) + +minetest.register_node("df_primordial_items:giant_fern_leaves", { + description = S("Giant Fern Leaves"), + _doc_items_longdesc = df_primordial_items.doc.giant_fern_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_fern_usage, + tiles = {"dfcaverns_jungle_fern_leaves_01.png"}, + visual_scale = 1.41, + inventory_image = "dfcaverns_jungle_fern_leaves_01.png", + wield_image = "dfcaverns_jungle_fern_leaves_01.png", + groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, + is_ground_content = false, + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + walkable = false, + waving = 2, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, + after_place_node = default.after_place_leaves, + drop = { + max_items = 1, + items = { + { + -- player will get sapling with 1/10 chance + items = {"df_primordial_items:fern_sapling"}, + rarity = 10, + }, + { + items = {"df_primordial_items:giant_fern_leaves"}, + } + } + }, +}) + +default.register_leafdecay({ + trunks = {"df_primordial_items:giant_fern_tree_slant_full", "df_primordial_items:giant_fern_tree_slant_top", "df_primordial_items:giant_fern_tree_slant_bottom", "df_primordial_items:giant_fern_tree"}, + leaves = {"df_primordial_items:giant_fern_leaves"}, + radius = 2, +}) + +------------------------------------------------------------------------------------ +-- Schematics + +local n1 = { name = "air", prob = 0 } +local n2 = { name = "df_primordial_items:giant_fern_leaves" } +local n3 = { name = "df_primordial_items:giant_fern_tree_slant_top" } +local n4 = { name = "df_primordial_items:giant_fern_tree_slant_full" } +local n5 = { name = "df_primordial_items:giant_fern_tree" } +local n6 = { name = "df_primordial_items:giant_fern_tree_slant_bottom" } + + +local fern_4_nodes_tall = { + size = {y = 4, x = 3, z = 4}, + center_pos = {y = 0, x = 1, z = 3}, + data = { + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, + n1, n2, n1, n2, n1, n1, n1, n1, n1, n1, n2, n3, n2, n1, n4, n1, n1, + n1, n1, n1, n6, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + } +} + +local fern_5_nodes_tall = { + size = {y = 5, x = 3, z = 4}, + center_pos = {y = 0, x = 1, z = 3}, + data = { + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n2, n1, n2, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n2, n3, n2, n1, n4, n1, n1, n1, n1, n1, n5, n1, n2, n6, n2, + n1, n1, n1, n1, n1, n1, n1, n1, n1, + } +} + +local fern_6_nodes_tall = { + size = {y = 6, x = 5, z = 4}, + center_pos = {y = 0, x = 2, z = 3}, + data = { + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n2, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n2, n2, n3, n2, n2, n1, n1, n4, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n2, n5, n2, n1, n2, n2, + n6, n2, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, + } +} + +local fern_9_nodes_tall = { + size = {y = 9, x = 5, z = 5}, + center_pos = {y = 0, x = 2, z = 4}, + data = { + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n2, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n2, n2, n3, n2, n2, n1, n1, n4, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n2, n2, n3, n2, n2, n2, n2, n6, n2, n2, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, + n5, n1, n1, n1, n2, n5, n2, n1, n1, n2, n6, n2, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, + } +} + +local ferns = {fern_4_nodes_tall, fern_5_nodes_tall, fern_6_nodes_tall, fern_9_nodes_tall} +local rotations = {0, 90, 180, 270} + +df_primordial_items.get_fern_schematic = function() + return ferns[math.random(1,4)] +end + +minetest.register_node("df_primordial_items:fern_sapling", { + description = S("Giant Fern Sapling"), + _doc_items_longdesc = df_primordial_items.doc.giant_fern_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_fern_usage, + tiles = {"dfcaverns_jungle_fern_03.png"}, + inventory_image = "dfcaverns_jungle_fern_03.png", + wield_image = "dfcaverns_jungle_fern_03.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, sapling = 1, light_sensitive_fungus = 13}, + _dfcaverns_dead_node = "default:dry_shrub", + selection_box = { + type = "fixed", + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} + }, + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, + on_construct = function(pos) + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") == 0 then + return + end + minetest.get_node_timer(pos):start(math.random( + df_trees.config.tree_min_growth_delay, + df_trees.config.tree_max_growth_delay)) + end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() + end, + on_timer = function(pos, elapsed) + if df_farming and df_farming.kill_if_sunlit(pos) then + return + end + + if minetest.get_node_light(pos) > 6 then + local fern = df_primordial_items.get_fern_schematic() + local rotation = rotations[math.random(1,#rotations)] + minetest.set_node(pos, {name="air"}) -- clear sapling so fern can replace it + mapgen_helper.place_schematic(pos, fern, rotation) + else + minetest.get_node_timer(pos):start(df_trees.config.tree_min_growth_delay) + end + end, +}) \ No newline at end of file diff --git a/df_primordial_items/giant_mycelium.lua b/df_primordial_items/giant_mycelium.lua new file mode 100644 index 0000000..9f8a8d9 --- /dev/null +++ b/df_primordial_items/giant_mycelium.lua @@ -0,0 +1,433 @@ +-- This file defines a type of root-like growth that spreads over the surface of the ground in a random web-like pattern + +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + +-- hub_thickness -- the bit in the middle that's seen at the ends and corners of long hypha runs +-- connector_thickness +local get_node_box = function(hub_thickness, connector_thickness) + return { + type = "connected", + fixed = {-hub_thickness,-hub_thickness,-hub_thickness,hub_thickness,hub_thickness,hub_thickness}, + connect_top = {-connector_thickness, 0, -connector_thickness, connector_thickness, 0.5, connector_thickness}, + connect_bottom = {-connector_thickness, -0.5, -connector_thickness, connector_thickness, 0, connector_thickness}, + connect_back = {-connector_thickness, -connector_thickness, 0, connector_thickness, connector_thickness, 0.5}, + connect_right = {0, -connector_thickness, -connector_thickness, 0.5, connector_thickness, connector_thickness}, + connect_front = {-connector_thickness, -connector_thickness, -0.5, connector_thickness, connector_thickness, 0}, + connect_left = {-0.5, -connector_thickness, -connector_thickness, 0, connector_thickness, connector_thickness}, + disconnected = {-connector_thickness, -connector_thickness, -connector_thickness, connector_thickness, connector_thickness, connector_thickness}, + } +end + +minetest.register_node("df_primordial_items:giant_hypha_root", { + description = S("Rooted Giant Hypha"), + _doc_items_longdesc = df_primordial_items.doc.giant_hyphae_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_hyphae_usage, + tiles = { + {name="dfcaverns_mush_giant_hypha.png"}, + }, + connects_to = {"group:soil", "group:hypha"}, + connect_sides = { "top", "bottom", "front", "left", "back", "right" }, + drawtype = "nodebox", + node_box = get_node_box(0.1875, 0.25), + collision_box = get_node_box(0.125, 0.1875), + paramtype = "light", + light_source = 2, + is_ground_content = false, + climbable = true, + groups = {oddly_breakable_by_hand = 1, choppy = 2, hypha = 1}, + sounds = df_trees.node_sound_tree_soft_fungus_defaults(), + drop = { + max_items = 1, + items = { + { + items = {"df_primordial_items:mycelial_fibers","df_primordial_items:giant_hypha_apical_meristem"}, + rarity = 100, + }, + { + items = {"df_primordial_items:mycelial_fibers"}, + }, + }, + }, +}) +minetest.register_node("df_primordial_items:giant_hypha", { + description = S("Giant Hypha"), + _doc_items_longdesc = df_primordial_items.doc.giant_hyphae_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_hyphae_usage, + tiles = { + {name="dfcaverns_mush_giant_hypha.png"}, + }, + connects_to = {"group:hypha"}, + connect_sides = { "top", "bottom", "front", "left", "back", "right" }, + drawtype = "nodebox", + node_box = get_node_box(0.1875, 0.25), + collision_box = get_node_box(0.125, 0.1875), + paramtype = "light", + light_source = 2, + is_ground_content = false, + climbable = true, + groups = {oddly_breakable_by_hand = 1, choppy = 2, hypha = 1}, + sounds = df_trees.node_sound_tree_soft_fungus_defaults(), + drop = { + max_items = 1, + items = { + { + items = {"df_primordial_items:mycelial_fibers","df_primordial_items:giant_hypha_apical_meristem"}, + rarity = 100, + }, + { + items = {"df_primordial_items:mycelial_fibers"}, + }, + }, + }, +}) + +minetest.register_craftitem("df_primordial_items:mycelial_fibers", { + description = S("Giant Mycelial Fibers"), + _doc_items_longdesc = df_primordial_items.doc.mycelial_fibers_desc, + _doc_items_usagehelp = df_primordial_items.doc.mycelial_fibers_usage, + groups = {wool = 1}, + inventory_image = "dfcaverns_mush_mycelial_fibers.png", +}) + +minetest.register_craftitem("df_primordial_items:mycelial_thread", { + description = S("Mycelial thread"), + _doc_items_longdesc = df_primordial_items.doc.mycelial_thread_desc, + _doc_items_usagehelp = df_primordial_items.doc.mycelial_thread_usage, + inventory_image = "dfcaverns_pig_tail_thread.png", + groups = {flammable = 1, thread = 1}, +}) + +minetest.register_craft({ + output = "df_primordial_items:mycelial_thread 4", + type = "shapeless", + recipe = { "df_primordial_items:mycelial_fibers"}, +}) + +-- Check each of the six cardinal directions to see if it's buildable-to, +-- if it has an adjacent "soil" node (or if it's going out over the corner of an adjacent soil node), +-- and does *not* have an adjacent hypha already. +-- By growing with these conditions hyphae will hug the ground and will not immediately loop back on themselves +-- (though they can run into other pre-existing growths, forming larger loops - which is fine, large loops are nice) + +local ystride = 3 +local zstride = 9 +local get_item_group = minetest.get_item_group +local get_node = minetest.get_node +local registered_nodes = minetest.registered_nodes +local math_random = math.random + +local find_mycelium_growth_targets = function(pos) + local nodes = {} + local pos_x = pos.x + local pos_y = pos.y + local pos_z = pos.z + + for x = -1, 1 do + for y = -1, 1 do + for z = -1, 1 do + if not (x == y and y == z) then -- we don't care about the diagonals or the center node + local node = get_node({x=pos_x+x, y=pos_y+y, z=pos_z+z}) + local node_name = node.name + if node_name == "ignore" then + -- Pause growth! We're at the edge of the known world. + return nil + end + if get_item_group(node_name, "soil") > 0 or + get_item_group(node_name, "stone") > 0 and math_random() < 0.5 then -- let hyphae explore out over stone + nodes[x + y*ystride + z*zstride] = "soil" + elseif get_item_group(node_name, "hypha") > 0 then + nodes[x + y*ystride + z*zstride] = "hypha" + elseif registered_nodes[node_name] and registered_nodes[node_name].buildable_to then + nodes[x + y*ystride + z*zstride] = "buildable" + end + end + end + end + end + + --TODO there's probably some clever way to turn this into a subroutine, but I'm tired right now and + --copy and pasting is easy and nobody's going to decide whether to hire or fire me based on this + --particular snippet of code so what the hell. I'll fix it later when that clever way comes to me. + local valid_targets = {} + if nodes[-1] == "buildable" and + -- test for soil to directly support new growth + (nodes[-1 -ystride] == "soil" or + nodes[-1 +ystride] == "soil" or + nodes[-1 -zstride] == "soil" or + nodes[-1 +zstride] == "soil" or + -- test for soil "around the corner" to allow for growth over an edge + nodes[-ystride] == "soil" or + nodes[ystride] == "soil" or + nodes[-zstride] == "soil" or + nodes[zstride] == "soil") + and not -- no adjacent hypha + (nodes[-1 -ystride] == "hypha" or + nodes[-1 +ystride] == "hypha" or + nodes[-1 -zstride] == "hypha" or + nodes[-1 +zstride] == "hypha") + then + table.insert(valid_targets, {x=pos_x-1, y=pos_y, z=pos_z}) + end + if nodes[1] == "buildable" and + -- test for soil to directly support new growth + (nodes[1 -ystride] == "soil" or + nodes[1 +ystride] == "soil" or + nodes[1 -zstride] == "soil" or + nodes[1 +zstride] == "soil" or + -- test for soil "around the corner" to allow for growth over an edge + nodes[-ystride] == "soil" or + nodes[ystride] == "soil" or + nodes[-zstride] == "soil" or + nodes[zstride] == "soil") + and not -- no adjacent hypha + (nodes[1 -ystride] == "hypha" or + nodes[1 +ystride] == "hypha" or + nodes[1 -zstride] == "hypha" or + nodes[1 +zstride] == "hypha") + then + table.insert(valid_targets, {x=pos_x+1, y=pos_y, z=pos_z}) + end + if nodes[-ystride] == "buildable" and + -- test for soil to directly support new growth + (nodes[-1 -ystride] == "soil" or + nodes[1 -ystride] == "soil" or + nodes[-ystride -zstride] == "soil" or + nodes[-ystride +zstride] == "soil" or + -- test for soil "around the corner" to allow for growth over an edge + nodes[-1] == "soil" or + nodes[1] == "soil" or + nodes[-zstride] == "soil" or + nodes[zstride] == "soil") + and not -- no adjacent hypha + (nodes[-1 -ystride] == "hypha" or + nodes[1 -ystride] == "hypha" or + nodes[-ystride -zstride] == "hypha" or + nodes[-ystride +zstride] == "hypha") + then + table.insert(valid_targets, {x=pos_x, y=pos_y-1, z=pos_z}) + end + if nodes[ystride] == "buildable" and + -- test for soil to directly support new growth + (nodes[-1 +ystride] == "soil" or + nodes[1 +ystride] == "soil" or + nodes[ystride -zstride] == "soil" or + nodes[ystride +zstride] == "soil" or + -- test for soil "around the corner" to allow for growth over an edge + nodes[-1] == "soil" or + nodes[1] == "soil" or + nodes[-zstride] == "soil" or + nodes[zstride] == "soil") + and not -- no adjacent hypha + (nodes[-1] == "hypha" or + nodes[1 + ystride] == "hypha" or + nodes[ystride -zstride] == "hypha" or + nodes[ystride +zstride] == "hypha") + then + table.insert(valid_targets, {x=pos_x, y=pos_y+1, z=pos_z}) + end + if nodes[-zstride] == "buildable" and + -- test for soil to directly support new growth + (nodes[-1 -zstride] == "soil" or + nodes[1 -zstride] == "soil" or + nodes[-ystride -zstride] == "soil" or + nodes[ystride -zstride] == "soil" or + -- test for soil "around the corner" to allow for growth over an edge + nodes[-1] == "soil" or + nodes[1] == "soil" or + nodes[-ystride] == "soil" or + nodes[ystride] == "soil") + and not -- no adjacent hypha + (nodes[-1 -zstride] == "hypha" or + nodes[1 -zstride] == "hypha" or + nodes[-ystride -zstride] == "hypha" or + nodes[ystride -zstride] == "hypha") + then + table.insert(valid_targets, {x=pos_x, y=pos_y, z=pos_z-1}) + end + if nodes[zstride] == "buildable" and + -- test for soil to directly support new growth + (nodes[-1 +zstride] == "soil" or + nodes[1 +zstride] == "soil" or + nodes[-ystride +zstride] == "soil" or + nodes[ystride +zstride] == "soil" or + -- test for soil "around the corner" to allow for growth over an edge + nodes[-1] == "soil" or + nodes[1] == "soil" or + nodes[-ystride] == "soil" or + nodes[ystride] == "soil") + and not -- no adjacent hypha + (nodes[-1 +zstride] == "hypha" or + nodes[1 +zstride] == "hypha" or + nodes[-ystride + zstride] == "hypha" or + nodes[ystride +zstride] == "hypha") + then + table.insert(valid_targets, {x=pos_x, y=pos_y, z=pos_z+1}) + end + + return valid_targets +end + +local grow_mycelium = function(pos, meristem_name) + local new_meristems = {} + -- Can we grow? If so, pick a random direction and add a new meristem there + local targets = find_mycelium_growth_targets(pos) + + if targets == nil then + return nil -- We hit the edge of the known world, pause! + end + + local target_count = #targets + if target_count > 0 then + local target = targets[math.random(1,target_count)] + minetest.set_node(target, {name=meristem_name}) + table.insert(new_meristems, target) + else + --nowhere to grow, turn into a rooted hypha and we're done + minetest.set_node(pos, {name="df_primordial_items:giant_hypha_root"}) + return new_meristems + end + + if math.random() < 0.06 then -- Note: hypha growth pattern is very sensitive to this branching factor. Higher than about 0.06 will blanket the landscape with fungus. + -- Split - try again from here next time + table.insert(new_meristems, pos) + -- Otherwise, just turn into a hypha and we're done + elseif math.random() < 0.333 then + minetest.set_node(pos, {name="df_primordial_items:giant_hypha_root"}) + else + minetest.set_node(pos, {name="df_primordial_items:giant_hypha"}) + end + return new_meristems +end + +local min_growth_delay = tonumber(minetest.settings:get("dfcaverns_mycelium_min_growth_delay")) or 240 +local max_growth_delay = tonumber(minetest.settings:get("dfcaverns_mycelium_max_growth_delay")) or 400 +local avg_growth_delay = (min_growth_delay + max_growth_delay) / 2 + +minetest.register_node("df_primordial_items:giant_hypha_apical_meristem", { + description = S("Giant Hypha Apical Meristem"), + tiles = { + {name="dfcaverns_mush_giant_hypha.png^[brighten"}, + }, + connects_to = {"group:hypha"}, + connect_sides = { "top", "bottom", "front", "left", "back", "right" }, + drawtype = "nodebox", + light_source = 6, + node_box = get_node_box(0.25, 0.375), + paramtype = "light", + + is_ground_content = false, + groups = {oddly_breakable_by_hand = 1, choppy = 2, hypha = 1, light_sensitive_fungus = 13}, + _dfcaverns_dead_node = "df_primordial_items:giant_hypha_root", + sounds = df_trees.node_sound_tree_soft_fungus_defaults(), + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(min_growth_delay, max_growth_delay)) + end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() + end, + on_timer = function(pos, elapsed) + if df_farming and df_farming.kill_if_sunlit(pos) then + return + end + + if elapsed > max_growth_delay then + -- We've been unloaded for a while, need to do multiple growth iterations. + local iterations = math.floor(elapsed / avg_growth_delay) -- the number of iterations we've missed + local stack = {pos} -- initialize with the current location + for i = 1, iterations do + local new_stack = {} -- populate this with new node output. + for _, stackpos in ipairs(stack) do -- for each currently growing location + local ret = grow_mycelium(stackpos, "df_primordial_items:giant_hypha_apical_meristem") + if ret == nil then + -- We hit the edge of the known world, stop and retry later + minetest.get_node_timer(stackpos):start(math.random(min_growth_delay,max_growth_delay)) + else + for _, retpos in ipairs(ret) do + -- put the new locations into new_stack + table.insert(new_stack, retpos) + end + end + end + stack = new_stack -- replace the old stack with the new + end + for _, donepos in ipairs(stack) do + -- After all the iterations are done, if there's any leftover growing positions set a timer for each of them + minetest.get_node_timer(donepos):start(math.random(min_growth_delay,max_growth_delay)) + end + else + -- just do one iteration. + local new_meristems = grow_mycelium(pos, "df_primordial_items:giant_hypha_apical_meristem") + if new_meristems == nil then + -- We hit the end of the known world, try again later. Unlikely in this case, but theoretically possible I guess. + minetest.get_node_timer(pos):start(math.random(min_growth_delay,max_growth_delay)) + else + for _, newpos in ipairs(new_meristems) do + minetest.get_node_timer(newpos):start(math.random(min_growth_delay,max_growth_delay)) + end + end + end + end, +}) + +-- this version grows instantly, it is meant for mapgen usage. + +local grow_mycelium_immediately = function(pos) + local stack = {pos} + while #stack > 0 do + local pos = table.remove(stack) + if not (df_farming and df_farming.kill_if_sunlit(pos)) then + local new_poses = grow_mycelium(pos, "df_primordial_items:giant_hypha_apical_mapgen") + if new_poses then + for _, new_pos in ipairs(new_poses) do + table.insert(stack, new_pos) + end + else + -- if we hit the end of the world, just stop. There'll be a mapgen meristem left here, re-trigger it. + minetest.get_node_timer(pos):start(math.random(10,60)) + end + end + end +end + +minetest.register_node("df_primordial_items:giant_hypha_apical_mapgen", { + description = S("Giant Hypha Apical Meristem"), + tiles = { + {name="dfcaverns_mush_giant_hypha.png^[brighten"}, + }, + connects_to = {"group:hypha"}, + connect_sides = { "top", "bottom", "front", "left", "back", "right" }, + drawtype = "nodebox", + _dfcaverns_dead_node = "df_primordial_items:giant_hypha_root", + light_source = 6, + node_box = get_node_box(0.25, 0.375), + paramtype = "light", + + is_ground_content = false, + groups = {oddly_breakable_by_hand = 1, choppy = 2, hypha = 1, not_in_creative_inventory = 1, light_sensitive_fungus = 13}, + sounds = df_trees.node_sound_tree_soft_fungus_defaults(), + on_timer = function(pos, elapsed) + grow_mycelium_immediately(pos) + end, + on_construct = function(pos) + minetest.get_node_timer(pos):start(1) + end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() + end, +}) + +-- Just in case mapgen fails to trigger the timer on a mapgen mycelium this ABM will clean up. +minetest.register_abm({ + label = "df_primordial_items ensure giant mycelium growth", + nodenames = {"df_primordial_items:giant_hypha_apical_mapgen"}, + interval = 10.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + local timer = minetest.get_node_timer(pos) + if not timer:is_started() then + timer:start(math.random(1,10)) + end + end, +}) \ No newline at end of file diff --git a/df_primordial_items/init.lua b/df_primordial_items/init.lua new file mode 100644 index 0000000..e59c0c4 --- /dev/null +++ b/df_primordial_items/init.lua @@ -0,0 +1,14 @@ +df_primordial_items = {} +df_primordial_items.doc = {} + +local MP = minetest.get_modpath(minetest.get_current_modname()) + +dofile(MP.."/doc.lua") +dofile(MP.."/jungle_nodes.lua") +dofile(MP.."/jungle_tree.lua") +dofile(MP.."/jungle_mushroom.lua") +dofile(MP.."/giant_fern.lua") +dofile(MP.."/fungal_nodes.lua") +dofile(MP.."/ceiling_fungus.lua") +dofile(MP.."/primordial_mushroom.lua") +dofile(MP.."/giant_mycelium.lua") \ No newline at end of file diff --git a/df_primordial_items/intllib.lua b/df_primordial_items/intllib.lua new file mode 100644 index 0000000..6669d72 --- /dev/null +++ b/df_primordial_items/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/df_primordial_items/jungle_mushroom.lua b/df_primordial_items/jungle_mushroom.lua new file mode 100644 index 0000000..b6eb346 --- /dev/null +++ b/df_primordial_items/jungle_mushroom.lua @@ -0,0 +1,176 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + +------------------------------------------------------------------------------------------ +-- Big jungle mushroom + +minetest.register_node("df_primordial_items:jungle_mushroom_trunk", { + description = S("Primordial Jungle Mushroom Trunk"), + _doc_items_longdesc = df_primordial_items.doc.big_mushroom_desc, + _doc_items_usagehelp = df_primordial_items.doc.big_mushroom_usage, + tiles = {"dfcaverns_jungle_mushroom_stem.png", "dfcaverns_jungle_mushroom_stem.png", "dfcaverns_jungle_mushroom_stem_02.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, + sounds = df_trees.node_sound_tree_soft_fungus_defaults(), + on_place = minetest.rotate_node +}) + +minetest.register_node("df_primordial_items:jungle_mushroom_cap_1", { + description = S("Pale Jungle Mushroom Cap"), + _doc_items_longdesc = df_primordial_items.doc.big_mushroom_desc, + _doc_items_usagehelp = df_primordial_items.doc.big_mushroom_usage, + tiles = {"dfcaverns_jungle_mushroom_top_02.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, primordial_mushroom_cap = 1}, + sounds = df_trees.node_sound_tree_soft_fungus_defaults(), + on_place = minetest.rotate_node, + drop = { + max_items = 1, + items = { + { + items = {"df_primordial_items:jungle_mushroom_sapling"}, + rarity = 10, + }, + { + items = {"df_primordial_items:jungle_mushroom_cap_1"}, + } + } + }, +}) + +minetest.register_node("df_primordial_items:jungle_mushroom_cap_2", { + description = S("Dark Jungle Mushroom Cap"), + _doc_items_longdesc = df_primordial_items.doc.big_mushroom_desc, + _doc_items_usagehelp = df_primordial_items.doc.big_mushroom_usage, + tiles = {"dfcaverns_jungle_mushroom_top_01.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, primordial_mushroom_cap = 1}, + sounds = df_trees.node_sound_tree_soft_fungus_defaults(), + on_place = minetest.rotate_node, + drop = { + max_items = 1, + items = { + { + items = {"df_primordial_items:jungle_mushroom_sapling"}, + rarity = 10, + }, + { + items = {"df_primordial_items:jungle_mushroom_cap_2"}, + } + } + }, +}) + +minetest.register_craftitem("df_primordial_items:diced_mushroom", { + description = S("Diced Mushroom"), + _doc_items_longdesc = df_primordial_items.doc.big_mushroom_desc, + _doc_items_usagehelp = df_primordial_items.doc.big_mushroom_usage, + inventory_image = "dfcaverns_mush_diced_giant_mushroom.png", + groups = {food = 1, dfcaverns_cookable = 1}, + sound = {eat = {name = "df_farming_gummy_chew", gain = 1.0}}, + on_use = minetest.item_eat(1), +}) + +minetest.register_craft({ + output = "df_primordial_items:diced_mushroom 4", + type = "shapeless", + recipe = { "group:primordial_mushroom_cap"}, +}) + +-- Note: no wood-making recipe for the trunk, it's pretty useless +minetest.register_craft({ + type = "fuel", + recipe = "df_primordial_items:jungle_mushroom_trunk", + burntime = 15, +}) + +minetest.register_node("df_primordial_items:jungle_mushroom_sapling", { + description = S("Primordial Jungle Mushroom Sapling"), + _doc_items_longdesc = df_primordial_items.doc.big_mushroom_desc, + _doc_items_usagehelp = df_primordial_items.doc.big_mushroom_usage, + tiles = {"dfcaverns_jungle_mushroom_02.png^[brighten"}, + inventory_image = "dfcaverns_jungle_mushroom_02.png^[brighten", + wield_image = "dfcaverns_jungle_mushroom_02.png^[brighten", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, light_sensitive_fungus = 13}, + selection_box = { + type = "fixed", + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} + }, + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, + + on_construct = function(pos) + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") == 0 then + return + end + minetest.get_node_timer(pos):start(math.random( + df_trees.config.tree_min_growth_delay, + df_trees.config.tree_max_growth_delay)) + end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() + end, + + on_timer = function(pos) + if df_farming and df_farming.kill_if_sunlit(pos) then + return + end + minetest.set_node(pos, {name="air"}) + df_primordial_items.spawn_jungle_mushroom(pos) + end, +}) + +local c_stem = minetest.get_content_id("df_primordial_items:jungle_mushroom_trunk") +local c_cap_1 = minetest.get_content_id("df_primordial_items:jungle_mushroom_cap_1") +local c_cap_2 = minetest.get_content_id("df_primordial_items:jungle_mushroom_cap_2") +local c_air = minetest.get_content_id("air") + +df_primordial_items.spawn_jungle_mushroom = function(pos) + local x, y, z = pos.x, pos.y, pos.z + local stem_height = math.random(1,3) + local cap_radius = math.random(2,3) + local maxy = y + stem_height + 3 + + local c_cap + if math.random() > 0.5 then + c_cap = c_cap_1 + else + c_cap = c_cap_2 + end + + local vm = minetest.get_voxel_manip() + local minp, maxp = vm:read_from_map( + {x = x - cap_radius, y = y, z = z - cap_radius}, + {x = x + cap_radius, y = maxy + 3, z = z + cap_radius} + ) + local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp}) + local data = vm:get_data() + + subterrane.giant_mushroom(area:indexp(pos), area, data, c_stem, c_cap, c_air, stem_height, cap_radius) + + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +df_primordial_items.spawn_jungle_mushroom_vm = function(vi, area, data) + local stem_height = math.random(1,3) + local cap_radius = math.random(2,3) + local c_cap + if math.random() > 0.5 then + c_cap = c_cap_1 + else + c_cap = c_cap_2 + end + subterrane.giant_mushroom(vi, area, data, c_stem, c_cap, c_air, stem_height, cap_radius) +end \ No newline at end of file diff --git a/df_primordial_items/jungle_nodes.lua b/df_primordial_items/jungle_nodes.lua new file mode 100644 index 0000000..3c38d05 --- /dev/null +++ b/df_primordial_items/jungle_nodes.lua @@ -0,0 +1,454 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + +local vegetation = +{ +} + + +---------------------------------------------------- +-- Ferns + +minetest.register_node("df_primordial_items:fern_1", { + description = S("Primordial Fern"), + _doc_items_longdesc = df_primordial_items.doc.fern_desc, + _doc_items_usagehelp = df_primordial_items.doc.fern_usage, + tiles = {"dfcaverns_jungle_fern_01.png"}, + inventory_image = "dfcaverns_jungle_fern_01.png", + wield_image = "dfcaverns_jungle_fern_01.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_jungle_plant = 1, light_sensitive_fungus = 13}, + _dfcaverns_dead_node = "default:dry_shrub", + visual_scale = 1.69, + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +minetest.register_node("df_primordial_items:fern_2", { + description = S("Primordial Fern"), + _doc_items_longdesc = df_primordial_items.doc.fern_desc, + _doc_items_usagehelp = df_primordial_items.doc.fern_usage, + tiles = {"dfcaverns_jungle_fern_02.png"}, + visual_scale = 1.69, + inventory_image = "dfcaverns_jungle_fern_02.png", + wield_image = "dfcaverns_jungle_fern_02.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_jungle_plant = 1, light_sensitive_fungus = 13}, + _dfcaverns_dead_node = "default:dry_shrub", + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +--------------------------------------------------------- +-- Glowing plants + +minetest.register_node("df_primordial_items:glow_plant_1", { + description = S("Primordial Flower"), + _doc_items_longdesc = df_primordial_items.doc.glow_plant_desc, + _doc_items_usagehelp = df_primordial_items.doc.glow_plant_usage, + tiles = {"dfcaverns_jungle_flower_01.png"}, + inventory_image = "dfcaverns_jungle_flower_01.png", + wield_image = "dfcaverns_jungle_flower_01.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_jungle_plant = 1, light_sensitive_fungus = 13}, + _dfcaverns_dead_node = "default:dry_shrub", + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + light_source = 6, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +minetest.register_node("df_primordial_items:glow_plant_2", { + description = S("Primordial Jungle Pod"), + _doc_items_longdesc = df_primordial_items.doc.glow_plant_desc, + _doc_items_usagehelp = df_primordial_items.doc.glow_plant_usage, + tiles = {"dfcaverns_jungle_glow_plant_01.png"}, + inventory_image = "dfcaverns_jungle_glow_plant_01.png", + wield_image = "dfcaverns_jungle_glow_plant_01.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_jungle_plant = 1, light_sensitive_fungus = 13}, + _dfcaverns_dead_node = "default:dry_shrub", + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + light_source = 6, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +minetest.register_node("df_primordial_items:glow_plant_3", { + description = S("Primordial Jungle Pod"), + _doc_items_longdesc = df_primordial_items.doc.glow_plant_desc, + _doc_items_usagehelp = df_primordial_items.doc.glow_plant_usage, + tiles = {"dfcaverns_jungle_glow_plant_02.png"}, + inventory_image = "dfcaverns_jungle_glow_plant_02.png", + wield_image = "dfcaverns_jungle_glow_plant_02.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_jungle_plant = 1, light_sensitive_fungus = 13}, + _dfcaverns_dead_node = "default:dry_shrub", + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + light_source = 6, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + + +------------------------------------------------------------------- +-- Grass + +minetest.register_node("df_primordial_items:jungle_grass_1", { + description = S("Primordial Jungle Grass"), + _doc_items_longdesc = df_primordial_items.doc.grass_desc, + _doc_items_usagehelp = df_primordial_items.doc.grass_usage, + tiles = {"dfcaverns_jungle_grass_01.png"}, + inventory_image = "dfcaverns_jungle_grass_01.png", + wield_image = "dfcaverns_jungle_grass_01.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_jungle_plant = 1, light_sensitive_fungus = 13}, + _dfcaverns_dead_node ="default:dry_grass_3", + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +minetest.register_node("df_primordial_items:jungle_grass_2", { + description = S("Primordial Jungle Grass"), + _doc_items_longdesc = df_primordial_items.doc.grass_desc, + _doc_items_usagehelp = df_primordial_items.doc.grass_usage, + tiles = {"dfcaverns_jungle_grass_02.png"}, + inventory_image = "dfcaverns_jungle_grass_02.png", + wield_image = "dfcaverns_jungle_grass_02.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_jungle_plant = 1, light_sensitive_fungus = 13}, + _dfcaverns_dead_node ="default:dry_grass_4", + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + place_param2 = 3, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +minetest.register_node("df_primordial_items:jungle_grass_3", { + description = S("Primordial Jungle Grass"), + _doc_items_longdesc = df_primordial_items.doc.grass_desc, + _doc_items_usagehelp = df_primordial_items.doc.grass_usage, + tiles = {"dfcaverns_jungle_grass_03.png"}, + inventory_image = "dfcaverns_jungle_grass_03.png", + wield_image = "dfcaverns_jungle_grass_03.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_jungle_plant = 1, light_sensitive_fungus = 13}, + _dfcaverns_dead_node ="default:dry_grass_4", + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + place_param2 = 3, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + + +----------------------------------------------------------------------------------------- +-- Ivy + +minetest.register_node("df_primordial_items:jungle_ivy", { + description = S("Primordial Jungle Ivy"), + _doc_items_longdesc = df_primordial_items.doc.ivy_desc, + _doc_items_usagehelp = df_primordial_items.doc.ivy_usage, + tiles = {"dfcaverns_jungle_ivy_01.png"}, + inventory_image = "dfcaverns_jungle_ivy_01.png", + wield_image = "dfcaverns_jungle_ivy_01.png", + groups = {snappy = 3, flora = 1, flammable = 1}, + paramtype = "light", + drawtype = "plantlike", + place_param2 = 3, + --paramtype2 = "wallmouinted", + --drawtype = "signlike", + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, + is_ground_content = false, + walkable = false, + climbable = true, +-- selection_box = { +-- type = "wallmounted", +-- }, +}) + +------------------------------------------------------------------------------------- +-- Small jungle mushrooms + +minetest.register_node("df_primordial_items:jungle_mushroom_1", { + description = S("Primordial Jungle Mushroom"), + _doc_items_longdesc = df_primordial_items.doc.small_mushroom_desc, + _doc_items_usagehelp = df_primordial_items.doc.small_mushroom_usage, + tiles = {"dfcaverns_jungle_mushroom_01.png^[multiply:#f3df2a"}, + inventory_image = "dfcaverns_jungle_mushroom_01.png^[multiply:#f3df2a", + wield_image = "dfcaverns_jungle_mushroom_01.png^[multiply:#f3df2a", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_jungle_plant = 1, light_sensitive_fungus = 11}, + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +minetest.register_node("df_primordial_items:jungle_mushroom_2", { + description = S("Large Primordial Jungle Mushroom"), + _doc_items_longdesc = df_primordial_items.doc.small_mushroom_desc, + _doc_items_usagehelp = df_primordial_items.doc.small_mushroom_usage, + tiles = {"dfcaverns_jungle_mushroom_02.png"}, + inventory_image = "dfcaverns_jungle_mushroom_02.png", + wield_image = "dfcaverns_jungle_mushroom_02.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, primordial_jungle_plant = 1, light_sensitive_fungus = 11}, + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + is_ground_content = false, + walkable = false, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, +}) + +---------------------------------------------------------------------------------------- +-- Dirt + +minetest.register_node("df_primordial_items:dirt_with_jungle_grass", { + description = S("Dirt With Primordial Jungle Grass"), + _doc_items_longdesc = df_primordial_items.doc.dirt_with_jungle_grass_desc, + _doc_items_usagehelp = df_primordial_items.doc.dirt_with_jungle_grass_usage, + tiles = {"dfcaverns_jungle_plant_grass_node_01.png"}, + paramtype = "light", + groups = {crumbly = 3, soil = 1, light_sensitive_fungus = 13}, + _dfcaverns_dead_node = "default:dirt", + is_ground_content = false, + drops = "default:dirt", + sounds = default.node_sound_dirt_defaults(), +}) + +minetest.register_abm{ + label = "df_primordial_items:jungle_grass_spread", + nodenames = {"default:dirt"}, + neighbors = {"df_mapitems:dirt_with_jungle_grass"}, + interval = 60, + chance = 50, + catch_up = true, + action = function(pos) + local above_def = minetest.registered_nodes[minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name] + if above_def and (above_def.buildable_to == true or above_def.walkable == false) then + minetest.swap_node(pos, {name="df_mapitems:dirt_with_jungle_grass"}) + end + end, +} + +minetest.register_node("df_primordial_items:plant_matter", { + description = S("Primordial Plant Matter"), + _doc_items_longdesc = df_primordial_items.doc.plant_matter_desc, + _doc_items_usagehelp = df_primordial_items.doc.plant_matter_usage, + tiles = {"dfcaverns_jungle_plant_matter_01.png"}, + is_ground_content = false, + paramtype = "light", + groups = {crumbly = 3, soil = 1}, + sounds = default.node_sound_dirt_defaults(), + on_timer = function(pos, elapsed) + if elapsed > 130 then + -- the timer triggered more than ten seconds after it was suppposed to, + -- it may have been in an unloaded block. Rather than have all the timers + -- go off at once now that the block's loaded, stagger them out again. + minetest.get_node_timer(pos):start(math.random(10, 120)) + return + end + if minetest.find_node_near(pos, 1, {"air"}) == nil then + minetest.set_node(pos, {name="df_primordial_items:packed_roots"}) + end + end, +}) + +minetest.register_node("df_primordial_items:packed_roots", { + description = S("Packed Primordial Jungle Roots"), + _doc_items_longdesc = df_primordial_items.doc.packed_roots_desc, + _doc_items_usagehelp = df_primordial_items.doc.packed_roots_usage, + tiles = {"dfcaverns_jungle_plant_packed_roots_01.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {choppy = 2, oddly_breakable_by_hand = 2}, + sounds = default.node_sound_wood_defaults(), +}) + + +if minetest.get_modpath("trail") and trail and trail.register_trample_node then + local HARDPACK_PROBABILITY = minetest.settings:get("trail_hardpack_probability") or 0.5 -- Chance walked dirt/grass is worn and compacted to trail:trail. + local HARDPACK_COUNT = minetest.settings:get("trail_hardpack_count") or 5 -- Number of times the above chance needs to be passed for soil to compact. + + trail.register_trample_node("df_primordial_items:dirt_with_jungle_grass", { + trampled_node_def_override = {description = S("Dirt With Primordial Jungle Grass and Footprint"),}, + footprint_opacity = 128, + hard_pack_node_name = "trail:trail", + hard_pack_probability = HARDPACK_PROBABILITY, + hard_pack_count = HARDPACK_COUNT, + }) + trail.register_trample_node("df_primordial_items:plant_matter", { + trampled_node_def_override = {description = S("Primordial Plant Matter with Footprint"),}, + footprint_opacity = 128, + hard_pack_node_name = "df_primordial_items:packed_roots", + hard_pack_probability = HARDPACK_PROBABILITY, + hard_pack_count = HARDPACK_COUNT, + }) +end + +minetest.register_craft({ + type = "fuel", + recipe = "df_primordial_items:packed_roots", + burntime = 40, +}) + +---------------------------------------------------------------------------------------- +-- Roots + +minetest.register_node("df_primordial_items:jungle_roots_1", { + description = S("Primordial Jungle Roots"), + _doc_items_longdesc = df_primordial_items.doc.roots_desc, + _doc_items_usagehelp = df_primordial_items.doc.roots_usage, + tiles = {"dfcaverns_jungle_root_01.png"}, + inventory_image = "dfcaverns_jungle_root_01.png", + wield_image = "dfcaverns_jungle_root_01.png", + groups = {snappy = 3, flora = 1, flammable = 1}, + paramtype = "light", + drawtype = "plantlike", + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, + walkable = false, + climbable = true, + is_ground_content = false, +}) + +minetest.register_node("df_primordial_items:jungle_roots_2", { + description = S("Primordial Jungle Root"), + _doc_items_longdesc = df_primordial_items.doc.roots_desc, + _doc_items_usagehelp = df_primordial_items.doc.roots_usage, + tiles = {"dfcaverns_jungle_root_02.png"}, + inventory_image = "dfcaverns_jungle_root_02.png", + wield_image = "dfcaverns_jungle_root_02.png", + groups = {snappy = 3, flora = 1, flammable = 1}, + paramtype = "light", + drawtype = "plantlike", + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + is_ground_content = false, + sunlight_propagates = true, + walkable = false, + climbable = true, +}) + +-------------------------------------------------------------------------------- +-- Thorns + +minetest.register_node("df_primordial_items:jungle_thorns", { + description = S("Primordial Jungle Thorns"), + _doc_items_longdesc = df_primordial_items.doc.thorn_desc, + _doc_items_usagehelp = df_primordial_items.doc.thorn_usage, + tiles = {"dfcaverns_jungle_thorns_01.png"}, + visual_scale = 1.41, + inventory_image = "dfcaverns_jungle_thorns_01.png", + wield_image = "dfcaverns_jungle_thorns_01.png", + groups = {snappy = 3, flora = 1, flammable = 1, primordial_jungle_plant = 1}, + paramtype = "light", + drawtype = "plantlike", + walkable = false, + is_ground_content = false, + place_param2 = 3, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, + damage_per_second = 1, +}) + + +-- TODO I had an idea to make thorns grow into mazes naturally using cellular automata rules, but it turned out to be +-- complicated and probably not worth it right now. Deal with it later. + +--local thorn_dir = +--{ +-- {x=1,y=0,z=1}, +-- {x=-1,y=0,z=-1}, +-- {x=1,y=0,z=0}, +-- {x=1,y=0,z=-1}, +-- {x=-1,y=0,z=0}, +-- {x=-1,y=0,z=1}, +--} +-- +-- +--local thorn_name = "df_primordial_items:jungle_thorns" +--minetest.register_abm({ +-- label = "Primordial thorn growth", +-- nodenames = {thorn_name}, +-- neighbors = {"group:soil"}, +-- interval = 1.0, +-- chance = 5, +-- catch_up = true, +-- action = function(pos, node, active_object_count, active_object_count_wider) +-- if math.random() < 0.1 then +-- local above = vector.add({x=0,y=1,z=0},pos) +-- local below = vector.add({x=0,y=-1,z=0},pos) +-- local above_node = minetest.get_node(above) +-- local below_node = minetest.get_node(below) +-- if above_node.name == "air" and minetest.get_item_group(below_node.name, "soil") then +-- minetest.set_node(above, {name=thorn_name}) +-- end +-- if below_node.name == "air" then +-- minetest.set_node(below, {name=thorn_name}) +-- end +-- return +-- end +-- +-- local dir = thorn_dir[math.random(#thorn_dir)] +-- local target_pos = vector.add(dir, pos) +-- -- This gets the corners of the target zone +-- local pos1 = vector.add(target_pos, thorn_dir[1]) +-- local pos2 = vector.add(target_pos, thorn_dir[2]) +-- +-- local list, counts = minetest.find_nodes_in_area(pos1, pos2, {thorn_name}) +-- local count = counts[thorn_name] +-- local target_node = minetest.get_node(target_pos) +-- -- Cellular automaton rule B3/S12345, approximately +-- if count == 3 and target_node.name == "air" then +-- minetest.set_node(target_pos, {name=thorn_name}) +-- elseif count > 5 then +-- minetest.set_node(target_pos, {name="air"}) +-- end +-- end +--}) diff --git a/df_primordial_items/jungle_tree.lua b/df_primordial_items/jungle_tree.lua new file mode 100644 index 0000000..a049cb9 --- /dev/null +++ b/df_primordial_items/jungle_tree.lua @@ -0,0 +1,262 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + +-- Leaves +minetest.register_node("df_primordial_items:jungle_leaves", { + description = S("Primordial Jungle Tree Leaves"), + _doc_items_longdesc = df_primordial_items.doc.leaves_desc, + _doc_items_usagehelp = df_primordial_items.doc.leaves_usage, + drawtype = "plantlike", + walkable = false, + waving = 2, + visual_scale = 1.4, + tiles = {"dfcaverns_jungle_leaves_01.png"}, + inventory_image = "dfcaverns_jungle_leaves_01.png", + wield_image = "dfcaverns_jungle_leaves_01.png", + paramtype = "light", + is_ground_content = false, + buildable_to = true, + groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, + sounds = default.node_sound_leaves_defaults(), + drop = { + max_items = 1, + items = { + { + items = {"df_primordial_items:jungletree_sapling"}, + rarity = 10, + }, + { + items = {"df_primordial_items:jungle_leaves"}, + } + } + }, + after_place_node = default.after_place_leaves, +}) + +minetest.register_node("df_primordial_items:jungle_leaves_glowing", { + description = S("Phosphorescent Primordial Jungle Tree Leaves"), + _doc_items_longdesc = df_primordial_items.doc.glowing_leaves_desc, + _doc_items_usagehelp = df_primordial_items.doc.glowing_leaves_usage, + drawtype = "plantlike", + walkable = false, + waving = 2, + visual_scale = 1.4, + tiles = {"dfcaverns_jungle_leaves_02.png"}, + inventory_image = "dfcaverns_jungle_leaves_02.png", + wield_image = "dfcaverns_jungle_leaves_02.png", + paramtype = "light", + is_ground_content = false, + buildable_to = true, + light_source = 2, + groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, + sounds = default.node_sound_leaves_defaults(), + drop = { + max_items = 1, + items = { + { + items = {"df_primordial_items:jungletree_sapling"}, + rarity = 10, + }, + { + items = {"df_primordial_items:jungle_leaves_glowing"}, + } + } + }, + after_place_node = default.after_place_leaves, +}) + +-- Trunk + +minetest.register_node("df_primordial_items:jungle_tree", { + description = S("Primordial Jungle Tree"), + _doc_items_longdesc = df_primordial_items.doc.tree_desc, + _doc_items_usagehelp = df_primordial_items.doc.tree_usage, + tiles = {"dfcaverns_jungle_wood_02.png", "dfcaverns_jungle_wood_02.png", "dfcaverns_jungle_wood_01.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, primordial_jungle_tree = 1}, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node +}) + +minetest.register_node("df_primordial_items:jungle_tree_mossy", { + description = S("Mossy Primordial Jungle Tree"), + _doc_items_longdesc = df_primordial_items.doc.tree_desc, + _doc_items_usagehelp = df_primordial_items.doc.tree_usage, + tiles = {"dfcaverns_jungle_wood_02.png", "dfcaverns_jungle_wood_02.png", "dfcaverns_jungle_wood_03.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, primordial_jungle_tree = 1}, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node +}) + +minetest.register_node("df_primordial_items:jungle_tree_glowing", { + description = S("Phosphorescent Primordial Jungle Tree"), + _doc_items_longdesc = df_primordial_items.doc.tree_glowing_desc, + _doc_items_usagehelp = df_primordial_items.doc.tree_glowing_usage, + tiles = {"dfcaverns_jungle_wood_02.png", "dfcaverns_jungle_wood_02.png", "dfcaverns_jungle_wood_04.png"}, + paramtype2 = "facedir", + is_ground_content = false, + light_source = 4, + groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, primordial_jungle_tree = 1}, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node +}) + +default.register_leafdecay({ + trunks = {"df_primordial_items:jungle_tree", "df_primordial_items:jungle_tree_mossy", "df_primordial_items:jungle_tree_glowing"}, + leaves = {"df_primordial_items:jungle_leaves", "df_primordial_items:jungle_leaves_glowing"}, + radius = 1, +}) + +minetest.register_craft({ + output = "default:junglewood 4", + recipe = { + {"group:primordial_jungle_tree"}, + } +}) + +---------------------------- +-- Spawn + +-- TODO: make use of the variant trunk and leaf nodes +local c_leaves = minetest.get_content_id("df_primordial_items:jungle_leaves") +local c_leaves_glow = minetest.get_content_id("df_primordial_items:jungle_leaves_glowing") +local c_trunk = minetest.get_content_id("df_primordial_items:jungle_tree") +local c_trunk_mossy = minetest.get_content_id("df_primordial_items:jungle_tree_mossy") +local c_trunk_glow = minetest.get_content_id("df_primordial_items:jungle_tree_glowing") + +df_primordial_items.spawn_jungle_tree = function(pos) + local x, y, z = pos.x, pos.y, pos.z + local height = math.random(8,14) + + local vm = minetest.get_voxel_manip() + local minp, maxp = vm:read_from_map( + {x = x - 2, y = y - 2, z = z - 2}, + {x = x + 2, y = y + height, z = z + 2} + ) + local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp}) + local data = vm:get_data() + local vi = area:indexp(pos) + + df_primordial_items.spawn_jungle_tree_vm(height, vi, area, data) + + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +local get_tree_nodes = function() + local rand = math.random() + if rand < 0.5 then + return c_trunk_glow, c_leaves_glow + end + if rand < 0.75 then + return c_trunk_mossy, c_leaves + end + return c_trunk, c_leaves +end + +df_primordial_items.spawn_jungle_tree_vm = function(height, vi, area, data) + local ystride = area.ystride + local zstride = area.zstride + local buildable_to = mapgen_helper.buildable_to + + local roots_done = {[vi] = true} + for i = 1, 6 do + local root_column = vi + math.random(-1,1) + math.random(-1,1)*zstride + if not roots_done[root_column] then + local trunknode = get_tree_nodes() + for y = -2, math.random(0,1) do -- root height is 1 to 2 nodes above ground + local root_index = root_column + y * ystride + if buildable_to(data[root_index]) then + data[root_index] = trunknode + end + end + end + roots_done[root_column] = true + end + + -- puts a trunk node in the center and surrounds it with leaves + local branch = function(bi, glow) + local trunknode, leafnode + if buildable_to(data[bi]) then + trunknode, leafnode = get_tree_nodes() + data[bi] = trunknode + else + return -- if a branch is placed in a non-viable place, don't add leaves + end + for x = -1, 1 do + for z = -1, 1 do + for y = -1, 1 do + if math.random() < 0.75 then + local li = bi + x + z*zstride + y*ystride + if buildable_to(data[li]) then + data[li] = leafnode + end + end + end + end + end + end + + for i = 0, height-2 do + local y_index = vi + i * ystride + if buildable_to(data[y_index]) then + data[y_index] = get_tree_nodes() + else + return -- if we hit something we can't grow through, stop. + end + if i > 4 then + local branch_index = y_index + math.random(-1,1) + math.random(-1,1)*zstride + branch(branch_index) + end + end + branch(vi + (height-1)*ystride) -- topper +end + +minetest.register_node("df_primordial_items:jungletree_sapling", { + description = S("Primordial Jungle Tree Sapling"), + _doc_items_longdesc = df_primordial_items.doc.tree_desc, + _doc_items_usagehelp = df_primordial_items.doc.tree_usage, + tiles = {"dfcaverns_jungle_sapling.png"}, + inventory_image = "dfcaverns_jungle_sapling.png", + wield_image = "dfcaverns_jungle_sapling.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, sapling = 1, light_sensitive_fungus = 13}, + _dfcaverns_dead_node = "default:dry_shrub", + selection_box = { + type = "fixed", + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} + }, + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + walkable = false, + is_ground_content = false, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, + on_construct = function(pos) + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") == 0 then + return + end + minetest.get_node_timer(pos):start(math.random( + df_trees.config.tree_min_growth_delay, + df_trees.config.tree_max_growth_delay)) + end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() + end, + on_timer = function(pos, elapsed) + if df_farming and df_farming.kill_if_sunlit(pos) then + return + end + if minetest.get_node_light(pos) > 6 then + df_primordial_items.spawn_jungle_tree(pos) + else + minetest.get_node_timer(pos):start(df_trees.config.tree_min_growth_delay) + end + end, +}) \ No newline at end of file diff --git a/df_primordial_items/license.txt b/df_primordial_items/license.txt new file mode 100644 index 0000000..d1b3d1c --- /dev/null +++ b/df_primordial_items/license.txt @@ -0,0 +1,24 @@ +Sounds and textures are under various licenses, see the license.txt file in the /sounds and /textures directories for details. + +License for Code +---------------- + +Copyright (C) 2019 FaceDeer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/df_primordial_items/locale/template.pot b/df_primordial_items/locale/template.pot new file mode 100644 index 0000000..7a58c95 --- /dev/null +++ b/df_primordial_items/locale/template.pot @@ -0,0 +1,389 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-01-26 16:09-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: df_primordial_items\ceiling_fungus.lua:9 +msgid "Primordial Fungal Lantern" +msgstr "" + +#: df_primordial_items\ceiling_fungus.lua:23 +msgid "Primordial Fungal Lantern Stalk" +msgstr "" + +#: df_primordial_items\ceiling_fungus.lua:35 +#: df_primordial_items\fungal_nodes.lua:50 +#: df_primordial_items\fungal_nodes.lua:69 +msgid "Primordial Fungal Orb" +msgstr "" + +#: df_primordial_items\doc.lua:5 +msgid "" +"Compared to the behemoths found elsewhere in the deep places of the world, " +"the giant mushrooms of the primordial jungles are on the smaller side - " +"often overwhelmed by the green plants that grow in the mysterious light " +"below. Still, they can become substantial resources." +msgstr "" + +#: df_primordial_items\doc.lua:6 +msgid "" +"The soft flesh of these large mushrooms is much less woody than other giant " +"mushrooms, making it ill-suited to structural use. This makes it rather more " +"nutritious, however." +msgstr "" + +#: df_primordial_items\doc.lua:8 +msgid "" +"The soil of the primordial jungle is rife with strange life at every scale." +msgstr "" + +#: df_primordial_items\doc.lua:9 +msgid "" +"When left uncultivated primordial jungle soil will sprout all manner of " +"strange wild plants." +msgstr "" + +#: df_primordial_items\doc.lua:10 +msgid "" +"Fungal fibers have infiltrated the ground in a spongy mass, making the soil " +"half mineral and half living matter." +msgstr "" + +#: df_primordial_items\doc.lua:11 +msgid "" +"When left uncultivated mycelial soil will sprout all manner of strange wild " +"fungi." +msgstr "" + +#: df_primordial_items\doc.lua:13 +msgid "" +"The dark-leaved ferns of the primordial jungle harken back to an earlier era " +"of life in the world." +msgstr "" + +#: df_primordial_items\doc.lua:15 +msgid "" +"These fibrous plants that grow in the deep appear similar to grass at a " +"glance, but they are more closely related to horsetails - a form of " +"vegetation from before the advent of modern plant forms. Ironically, pale " +"cave wheat is more kin to surface grass than this is." +msgstr "" + +#: df_primordial_items\doc.lua:18 +msgid "" +"Tangled weaves of ivy hang from the ceiling where there are wide enough gaps " +"between the bright sources of light." +msgstr "" + +#: df_primordial_items\doc.lua:19 +msgid "" +"Ivy is climbable, if it hangs close enough to the ground it can serve as a " +"path between floor and ceiling." +msgstr "" + +#: df_primordial_items\doc.lua:20 +msgid "" +"Somewhere above an enormous plant has wedged its roots down through the rock " +"and emerged from the ceiling of another cavern." +msgstr "" + +#: df_primordial_items\doc.lua:21 +msgid "These hanging roots are climbable." +msgstr "" + +#: df_primordial_items\doc.lua:23 +msgid "" +"Questing fibers of fungal mycelium sometimes erupt from the soil and reach " +"upward, driven by chemical cues to seek out nourishment above. They look a " +"lot like white grass, at a glance." +msgstr "" + +#: df_primordial_items\doc.lua:26 +msgid "" +"The large woody plants of the primordial jungle are similar in appearance to " +"the jungle trees of the surface, but are a result of convergent evolution " +"from ancient cycad plants toward a common form." +msgstr "" + +#: df_primordial_items\doc.lua:27 +msgid "" +"Like wood of the surface world, primordial jungle trees can be chopped and " +"carved as building material or as fuel." +msgstr "" + +#: df_primordial_items\doc.lua:28 +msgid "" +"The cracks in the bark of some primordial jungle trees become host to " +"phosphorescent veins of symbiotic fungus." +msgstr "" + +#: df_primordial_items\doc.lua:29 +msgid "" +"The glowing bark fungus doesn't extend into the wood of the trunk, resulting " +"in surprisingly mundane building material when hewn." +msgstr "" + +#: df_primordial_items\doc.lua:32 +msgid "" +"Some fronds of primordial jungle trees also become host to the " +"phosphorescent fungus that creeps through cracks in the bark." +msgstr "" + +#: df_primordial_items\doc.lua:35 +msgid "" +"The still air of these ancient caverns have allowed ferns to grow to " +"prodigious sizes, where storms and rain would normally tear their weaker " +"fronds off on the surface of the world." +msgstr "" + +#: df_primordial_items\doc.lua:36 +msgid "" +"When a fern grows to such sizes its stem becomes dense enough to be used as " +"a form of wood." +msgstr "" + +#: df_primordial_items\doc.lua:38 +msgid "" +"Fungus in its purest form, these gigantic rope-like hyphae creep over the " +"surface of soil and burrow in to feed wherever nutrients are sensed." +msgstr "" + +#: df_primordial_items\doc.lua:39 +msgid "" +"Much like a rope, hyphae have fibers inside that can be unraveled and used " +"for a variety of crafts." +msgstr "" + +#: df_primordial_items\doc.lua:40 +msgid "Fibers extracted from gigantic fungal hyphae." +msgstr "" + +#: df_primordial_items\doc.lua:45 +msgid "" +"The grandest of the great mushroom species can be found in the deepest " +"primordial caverns. Their broad caps have hanging gills." +msgstr "" + +#: df_primordial_items\doc.lua:46 +msgid "" +"Much like the giant mushrooms of higher cavern layers, these can be carved " +"into woody material for use as fuel or for building things. The grain of " +"these primordial mushrooms is knurled." +msgstr "" + +#: df_primordial_items\doc.lua:63 +msgid "" +"The steady light and unchanging growing conditions of the primordial caverns " +"have led to great mountainous masses of plant material growing in " +"particularly fertile spots, hardly identifiable as individual organisms." +msgstr "" + +#: df_primordial_items\doc.lua:64 +msgid "" +"The gnarled interwoven root-like foundations of this plant material is not " +"useful as building material, but can serve as a fuel source." +msgstr "" + +#: df_primordial_items\fungal_nodes.lua:11 +#: df_primordial_items\fungal_nodes.lua:29 +msgid "Primordial Fungal Grass" +msgstr "" + +#: df_primordial_items\fungal_nodes.lua:88 +msgid "Primordial Fungal Pod" +msgstr "" + +#: df_primordial_items\fungal_nodes.lua:110 +msgid "Dirt with Primordial Mycelium" +msgstr "" + +#: df_primordial_items\fungal_nodes.lua:126 +msgid "Dirt with Primordial Mycelium and Footprint" +msgstr "" + +#: df_primordial_items\giant_fern.lua:9 +#: df_primordial_items\giant_fern.lua:23 +#: df_primordial_items\giant_fern.lua:60 +#: df_primordial_items\giant_fern.lua:97 +msgid "Giant Fern Stem" +msgstr "" + +#: df_primordial_items\giant_fern.lua:134 +msgid "Fern Wood" +msgstr "" + +#: df_primordial_items\giant_fern.lua:152 +msgid "Giant Fern Leaves" +msgstr "" + +#: df_primordial_items\giant_fern.lua:267 +msgid "Giant Fern Sapling" +msgstr "" + +#: df_primordial_items\giant_mycelium.lua:24 +msgid "Rooted Giant Hypha" +msgstr "" + +#: df_primordial_items\giant_mycelium.lua:53 +msgid "Giant Hypha" +msgstr "" + +#: df_primordial_items\giant_mycelium.lua:83 +msgid "Giant Mycelial Fibers" +msgstr "" + +#: df_primordial_items\giant_mycelium.lua:91 +msgid "Mycelial thread" +msgstr "" + +#: df_primordial_items\giant_mycelium.lua:297 +#: df_primordial_items\giant_mycelium.lua:362 +msgid "Giant Hypha Apical Meristem" +msgstr "" + +#: df_primordial_items\jungle_mushroom.lua:9 +msgid "Primordial Jungle Mushroom Trunk" +msgstr "" + +#: df_primordial_items\jungle_mushroom.lua:21 +msgid "Pale Jungle Mushroom Cap" +msgstr "" + +#: df_primordial_items\jungle_mushroom.lua:45 +msgid "Dark Jungle Mushroom Cap" +msgstr "" + +#: df_primordial_items\jungle_mushroom.lua:69 +msgid "Diced Mushroom" +msgstr "" + +#: df_primordial_items\jungle_mushroom.lua:91 +msgid "Primordial Jungle Mushroom Sapling" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:14 +#: df_primordial_items\jungle_nodes.lua:33 +msgid "Primordial Fern" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:55 +msgid "Primordial Flower" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:74 +#: df_primordial_items\jungle_nodes.lua:93 +msgid "Primordial Jungle Pod" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:116 +#: df_primordial_items\jungle_nodes.lua:134 +#: df_primordial_items\jungle_nodes.lua:153 +msgid "Primordial Jungle Grass" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:176 +msgid "Primordial Jungle Ivy" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:203 +#: df_primordial_items\jungle_nodes.lua:221 +msgid "Primordial Jungle Mushroom" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:242 +msgid "Dirt With Primordial Jungle Grass" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:252 +msgid "Primordial Plant Matter" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:270 +msgid "Dirt With Primordial Jungle Grass and Footprint" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:277 +msgid "Primordial Plant Matter with Footprint" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:286 +msgid "Packed Primordial Jungle Roots" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:300 +msgid "Primordial Jungle Roots" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:318 +msgid "Primordial Jungle Root" +msgstr "" + +#: df_primordial_items\jungle_nodes.lua:339 +msgid "Primordial Jungle Thorns" +msgstr "" + +#: df_primordial_items\jungle_tree.lua:7 +msgid "Primordial Jungle Tree Leaves" +msgstr "" + +#: df_primordial_items\jungle_tree.lua:38 +msgid "Phosphorescent Primordial Jungle Tree Leaves" +msgstr "" + +#: df_primordial_items\jungle_tree.lua:72 +msgid "Primordial Jungle Tree" +msgstr "" + +#: df_primordial_items\jungle_tree.lua:84 +msgid "Mossy Primordial Jungle Tree" +msgstr "" + +#: df_primordial_items\jungle_tree.lua:96 +msgid "Phosphorescent Primordial Jungle Tree" +msgstr "" + +#: df_primordial_items\jungle_tree.lua:225 +msgid "Primordial Jungle Tree Sapling" +msgstr "" + +#: df_primordial_items\primordial_mushroom.lua:6 +msgid "Primordial Mushroom Trunk" +msgstr "" + +#: df_primordial_items\primordial_mushroom.lua:18 +msgid "Primordial Mushroom Cap" +msgstr "" + +#: df_primordial_items\primordial_mushroom.lua:30 +msgid "Primordial Mushroom Gills" +msgstr "" + +#: df_primordial_items\primordial_mushroom.lua:61 +msgid "Glowing Primordial Mushroom Gills" +msgstr "" + +#: df_primordial_items\primordial_mushroom.lua:99 +msgid "Primordial Mushroom Trunk Wood" +msgstr "" + +#: df_primordial_items\primordial_mushroom.lua:117 +msgid "Primordial Cap Wood" +msgstr "" + +#: df_primordial_items\primordial_mushroom.lua:692 +msgid "Primordial Mushroom Spawn" +msgstr "" diff --git a/df_primordial_items/locale/update.bat b/df_primordial_items/locale/update.bat new file mode 100644 index 0000000..48b25ab --- /dev/null +++ b/df_primordial_items/locale/update.bat @@ -0,0 +1,6 @@ +@echo off +setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION +cd .. +set LIST= +for /r %%X in (*.lua) do set LIST=!LIST! %%X +..\..\intllib\tools\xgettext.bat %LIST% \ No newline at end of file diff --git a/df_primordial_items/mod.conf b/df_primordial_items/mod.conf new file mode 100644 index 0000000..2f8aeeb --- /dev/null +++ b/df_primordial_items/mod.conf @@ -0,0 +1,4 @@ +name = df_primordial_items +description = A collection of flora found in the "primordial" cavern layer of DF Caverns +depends = default, mapgen_helper, subterrane, df_underworld_items, df_trees +optional_depends = trail, df_farming \ No newline at end of file diff --git a/df_primordial_items/models/dfcaverns_fern_slant.obj b/df_primordial_items/models/dfcaverns_fern_slant.obj new file mode 100644 index 0000000..c856ac9 --- /dev/null +++ b/df_primordial_items/models/dfcaverns_fern_slant.obj @@ -0,0 +1,74 @@ +# Blender v2.79 (sub 0) OBJ File: '' +# www.blender.org +g tunnel_tube_slant_2_Bottom_tunnel_tube_slant_Cube.002_Bottom +v 0.500000 -0.500000 -0.500000 +v 0.500000 -0.500000 0.500000 +v -0.500000 -0.500000 -0.500000 +v -0.500000 -0.500000 0.500000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt -0.000000 0.000000 +vt 0.000000 1.000000 +vn 0.0000 -1.0000 -0.0000 +s 1 +f 1/1/1 2/2/1 4/3/1 3/4/1 +g tunnel_tube_slant_5_Front_tunnel_tube_slant_Cube.002_Front +v 0.500000 -0.500000 0.500000 +v 0.500000 0.500000 0.000000 +v -0.500000 0.500000 0.000000 +v -0.500000 -0.500000 0.500000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt -0.000000 0.000000 +vn 0.0000 0.4472 0.8944 +s 1 +f 5/5/2 6/6/2 7/7/2 8/8/2 +g tunnel_tube_slant_1_Top_tunnel_tube_slant_Cube.002_Top +v 0.500000 0.500000 -1.000000 +v -0.500000 0.500000 -1.000000 +v 0.500000 0.500000 0.000000 +v -0.500000 0.500000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt -0.000000 0.000000 +vt 1.000000 -0.000000 +vn 0.0000 1.0000 0.0000 +s 1 +f 9/9/3 10/10/3 12/11/3 11/12/3 +g tunnel_tube_slant_3_Left_tunnel_tube_slant_Cube.002_Left +v -0.500000 -0.500000 0.500000 +v -0.500000 0.500000 0.000000 +v -0.500000 0.500000 -1.000000 +v -0.500000 -0.500000 -0.500000 +vt -0.000000 0.000000 +vt 0.500000 1.000000 +vt 1.500000 1.000000 +vt 1.000000 0.000000 +vn -1.0000 0.0000 0.0000 +s 1 +f 13/13/4 14/14/4 15/15/4 16/16/4 +g tunnel_tube_slant_6_Back_tunnel_tube_slant_Cube.002_Back +v 0.500000 0.500000 -1.000000 +v 0.500000 -0.500000 -0.500000 +v -0.500000 -0.500000 -0.500000 +v -0.500000 0.500000 -1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vn 0.0000 -0.4472 -0.8944 +s 1 +f 17/17/5 18/18/5 19/19/5 20/20/5 +g tunnel_tube_slant_4_Right_tunnel_tube_slant_Cube.002_Right +v 0.500000 -0.500000 -0.500000 +v 0.500000 0.500000 -1.000000 +v 0.500000 0.500000 0.000000 +v 0.500000 -0.500000 0.500000 +vt 1.000000 0.000000 +vt 1.500000 1.000000 +vt 0.500000 1.000000 +vt 0.000000 0.000000 +vn 1.0000 0.0000 0.0000 +s 1 +f 21/21/6 22/22/6 23/23/6 24/24/6 diff --git a/df_primordial_items/models/dfcaverns_fern_slant_2.obj b/df_primordial_items/models/dfcaverns_fern_slant_2.obj new file mode 100644 index 0000000..c736027 --- /dev/null +++ b/df_primordial_items/models/dfcaverns_fern_slant_2.obj @@ -0,0 +1,74 @@ +# Blender v2.79 (sub 0) OBJ File: '' +# www.blender.org +g tunnel_tube_slant_Cube.002_Bottom.001 +v 0.500000 -0.500000 -0.000000 +v 0.500000 -0.500000 1.000000 +v -0.500000 -0.500000 -0.000000 +v -0.500000 -0.500000 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt -0.000000 0.000000 +vt 0.000000 1.000000 +vn 0.0000 -1.0000 -0.0000 +s 1 +f 1/1/1 2/2/1 4/3/1 3/4/1 +g tunnel_tube_slant_Cube.002_Front.001 +v 0.500000 -0.500000 1.000000 +v 0.500000 0.500000 0.500000 +v -0.500000 0.500000 0.500000 +v -0.500000 -0.500000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt -0.000000 0.000000 +vn 0.0000 0.4472 0.8944 +s 1 +f 5/5/2 6/6/2 7/7/2 8/8/2 +g tunnel_tube_slant_Cube.002_Top.001 +v 0.500000 0.500000 -0.500000 +v -0.500000 0.500000 -0.500000 +v 0.500000 0.500000 0.500000 +v -0.500000 0.500000 0.500000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt -0.000000 0.000000 +vt 1.000000 -0.000000 +vn 0.0000 1.0000 0.0000 +s 1 +f 9/9/3 10/10/3 12/11/3 11/12/3 +g tunnel_tube_slant_Cube.002_Left.001 +v -0.500000 -0.500000 1.000000 +v -0.500000 0.500000 0.500000 +v -0.500000 0.500000 -0.500000 +v -0.500000 -0.500000 -0.000000 +vt -0.500000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 1.000000 +vt 0.500000 0.000000 +vn -1.0000 -0.0000 0.0000 +s 1 +f 13/13/4 14/14/4 15/15/4 16/16/4 +g tunnel_tube_slant_Cube.002_Back.001 +v 0.500000 0.500000 -0.500000 +v 0.500000 -0.500000 -0.000000 +v -0.500000 -0.500000 -0.000000 +v -0.500000 0.500000 -0.500000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vn 0.0000 -0.4472 -0.8944 +s 1 +f 17/17/5 18/18/5 19/19/5 20/20/5 +g tunnel_tube_slant_Cube.002_Right.001 +v 0.500000 -0.500000 -0.000000 +v 0.500000 0.500000 -0.500000 +v 0.500000 0.500000 0.500000 +v 0.500000 -0.500000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt -0.500000 0.000000 +vn 1.0000 -0.0000 0.0000 +s 1 +f 21/21/6 22/22/6 23/23/6 24/24/6 diff --git a/df_primordial_items/models/dfcaverns_fern_slant_full.obj b/df_primordial_items/models/dfcaverns_fern_slant_full.obj new file mode 100644 index 0000000..b410d18 --- /dev/null +++ b/df_primordial_items/models/dfcaverns_fern_slant_full.obj @@ -0,0 +1,74 @@ +# Blender v2.79 (sub 0) OBJ File: '' +# www.blender.org +g tunnel_tube_slant_Cube.002_Bottom.002 +v 0.500000 -0.500000 -0.500000 +v 0.500000 -0.500000 0.500000 +v -0.500000 -0.500000 -0.500000 +v -0.500000 -0.500000 0.500000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt -0.000000 0.000000 +vt 0.000000 1.000000 +vn 0.0000 -1.0000 -0.0000 +s 1 +f 1/1/1 2/2/1 4/3/1 3/4/1 +g tunnel_tube_slant_Cube.002_Front.002 +v 0.500000 -0.500000 0.500000 +v 0.500000 0.500000 -0.500000 +v -0.500000 0.500000 -0.500000 +v -0.500000 -0.500000 0.500000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt -0.000000 0.000000 +vn 0.0000 0.7071 0.7071 +s 1 +f 5/5/2 6/6/2 7/7/2 8/8/2 +g tunnel_tube_slant_Cube.002_Top.002 +v 0.500000 0.500000 -1.500000 +v -0.500000 0.500000 -1.500000 +v 0.500000 0.500000 -0.500000 +v -0.500000 0.500000 -0.500000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt -0.000000 0.000000 +vt 1.000000 -0.000000 +vn 0.0000 1.0000 0.0000 +s 1 +f 9/9/3 10/10/3 12/11/3 11/12/3 +g tunnel_tube_slant_Cube.002_Left.002 +v -0.500000 -0.500000 0.500000 +v -0.500000 0.500000 -0.500000 +v -0.500000 0.500000 -1.500000 +v -0.500000 -0.500000 -0.500000 +vt -0.000000 0.000000 +vt 1.000000 1.000000 +vt 2.000000 1.000000 +vt 1.000000 0.000000 +vn -1.0000 0.0000 0.0000 +s 1 +f 13/13/4 14/14/4 15/15/4 16/16/4 +g tunnel_tube_slant_Cube.002_Back.002 +v 0.500000 0.500000 -1.500000 +v 0.500000 -0.500000 -0.500000 +v -0.500000 -0.500000 -0.500000 +v -0.500000 0.500000 -1.500000 +vt 1.000000 1.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vn 0.0000 -0.7071 -0.7071 +s 1 +f 17/17/5 18/18/5 19/19/5 20/20/5 +g tunnel_tube_slant_Cube.002_Right.002 +v 0.500000 -0.500000 -0.500000 +v 0.500000 0.500000 -1.500000 +v 0.500000 0.500000 -0.500000 +v 0.500000 -0.500000 0.500000 +vt 1.000000 0.000000 +vt 2.000000 1.000000 +vt 1.000000 1.000000 +vt 0.000000 0.000000 +vn 1.0000 -0.0000 0.0000 +s 1 +f 21/21/6 22/22/6 23/23/6 24/24/6 diff --git a/df_primordial_items/primordial_mushroom.lua b/df_primordial_items/primordial_mushroom.lua new file mode 100644 index 0000000..14b29a5 --- /dev/null +++ b/df_primordial_items/primordial_mushroom.lua @@ -0,0 +1,728 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + +minetest.register_node("df_primordial_items:mushroom_trunk", { + description = S("Primordial Mushroom Trunk"), + _doc_items_longdesc = df_primordial_items.doc.giant_mushroom_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_mushroom_usage, + tiles = {"dfcaverns_mush_shaft_top.png", "dfcaverns_mush_shaft_top.png", "dfcaverns_mush_shaft_side.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, + sounds = df_trees.node_sound_tree_soft_fungus_defaults(), + on_place = minetest.rotate_node +}) + +minetest.register_node("df_primordial_items:mushroom_cap", { + description = S("Primordial Mushroom Cap"), + _doc_items_longdesc = df_primordial_items.doc.giant_mushroom_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_mushroom_usage, + tiles = {"dfcaverns_mush_cap.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, + sounds = df_trees.node_sound_tree_soft_fungus_defaults(), + on_place = minetest.rotate_node +}) + +minetest.register_node("df_primordial_items:mushroom_gills", { + description = S("Primordial Mushroom Gills"), + _doc_items_longdesc = df_primordial_items.doc.gills_desc, + _doc_items_usagehelp = df_primordial_items.doc.gills_usage, + tiles = {"dfcaverns_mush_gills.png"}, + inventory_image = "dfcaverns_mush_gills.png", + wield_image = "dfcaverns_mush_gills.png", + groups = {snappy = 3, flora = 1, flammable = 1, leaves = 1}, + paramtype = "light", + drawtype = "plantlike", + waving = 2, + walkable = false, + is_ground_content = false, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, + drop = { + max_items = 1, + items = { + { + -- player will get sapling with 1/20 chance + items = {"df_primordial_items:mush_sapling"}, + rarity = 20, + }, + { + items = {"df_primordial_items:mushroom_gills"}, + } + } + }, +}) + +minetest.register_node("df_primordial_items:mushroom_gills_glowing", { + description = S("Glowing Primordial Mushroom Gills"), + _doc_items_longdesc = df_primordial_items.doc.gills_desc, + _doc_items_usagehelp = df_primordial_items.doc.gills_usage, + tiles = {"dfcaverns_mush_gills_glow.png"}, + inventory_image = "dfcaverns_mush_gills_glow.png", + wield_image = "dfcaverns_mush_gills_glow.png", + groups = {snappy = 3, flora = 1, flammable = 1, leaves = 1}, + paramtype = "light", + drawtype = "plantlike", + waving = 2, + walkable = false, + is_ground_content = false, + light_source = 6, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, + drop = { + max_items = 1, + items = { + { + -- player will get sapling with 1/20 chance + items = {"df_primordial_items:mush_sapling"}, + rarity = 20, + }, + { + items = {"df_primordial_items:mushroom_gills_glowing"}, + } + } + }, +}) + +default.register_leafdecay({ + trunks = {"df_primordial_items:mushroom_trunk", "df_primordial_items:mushroom_cap"}, + leaves = {"df_primordial_items:mushroom_gills", "df_primordial_items:mushroom_gills_glowing"}, + radius = 5, +}) + +minetest.register_node("df_primordial_items:primordial_mush_trunk_wood", { + description = S("Primordial Mushroom Trunk Wood"), + _doc_items_longdesc = df_primordial_items.doc.giant_mushroom_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_mushroom_usage, + paramtype2 = "facedir", + tiles = {"dfcaverns_mush_shaft_side.png^(dfcaverns_mush_gills.png^[multiply:#888888)"}, + is_ground_content = false, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_craft({ + output = "df_primordial_items:primordial_mush_trunk_wood 4", + recipe = { + {"df_primordial_items:mushroom_trunk"}, + } +}) + +minetest.register_node("df_primordial_items:primordial_mush_cap_wood", { + description = S("Primordial Cap Wood"), + _doc_items_longdesc = df_primordial_items.doc.giant_mushroom_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_mushroom_usage, + paramtype2 = "facedir", + tiles = {"dfcaverns_mush_cap.png^dfcaverns_mush_gills.png"}, + is_ground_content = false, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_craft({ + output = "df_primordial_items:primordial_mush_cap_wood 4", + recipe = { + {"df_primordial_items:mushroom_cap"}, + } +}) + +------ +-- Schematics: +-- Originally created by ClockGen, released under CC-BY 4.0 + +local replace_on_buildable_to = function(old_node_id, data, area, vi) + return mapgen_helper.buildable_to(old_node_id) +end + +local n1 = {name="air", prob=0} +local n2 = {name="df_primordial_items:mushroom_gills"} +local n3 = {name="df_primordial_items:mushroom_cap", place_on_condition = replace_on_buildable_to} +local n4 = {name="df_primordial_items:mushroom_trunk", place_on_condition = replace_on_buildable_to} +local n5 = {name="df_primordial_items:mushroom_gills_glowing"} + +local bc_mushroom_3 = { + size = {x=3, y=3, z=3}, + center_pos = {x=1, y=0, z=1}, + data = { + n1, n1, n1, n2, n2, n1, n3, n3, n3, n1, n4, n1, n2, n4, n5, n3, n3, + n3, n1, n1, n1, n1, n5, n1, n3, n3, n3, + }, +} + +local bc_mushroom_5 = { + size = {x=5, y=5, z=5}, + center_pos = {x=2, y=0, z=2}, + data = { + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, + n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n2, n1, n1, n1, n3, n2, n5, n2, n3, n1, n3, n3, n3, n1, n1, + n1, n4, n1, n1, n1, n1, n4, n1, n1, n1, n2, n4, n5, n1, n3, n2, n4, + n5, n3, n1, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n5, n2, n1, n1, n3, n5, n2, n2, n3, n1, n3, n3, n3, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, + n1, n1, n1, n1, n1, n1, + }, +} + +local bc_mushroom_9 = { + size = {x=9, y=9, z=9}, + center_pos = {x=4, y=0, z=4}, + data = { + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, + n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, n2, n3, n3, n3, n1, + n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, + n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n5, + n2, n1, n1, n1, n1, n3, n3, n2, n5, n2, n3, n3, n1, n1, n1, n1, n3, + n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, + n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + n3, n3, n2, n2, n5, n2, n2, n3, n3, n1, n1, n3, n3, n3, n3, n3, n1, + n1, n1, n1, n1, n1, n4, n1, n1, n1, n1, n1, n1, n1, n1, n4, n1, n1, + n1, n1, n1, n1, n1, n1, n4, n1, n1, n1, n1, n1, n1, n1, n1, n4, n1, + n1, n5, n1, n1, n5, n1, n1, n4, n2, n1, n5, n1, n1, n5, n1, n5, n4, + n2, n1, n5, n1, n1, n5, n1, n5, n4, n2, n2, n5, n1, n3, n5, n2, n5, + n4, n2, n5, n5, n3, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, + n1, n1, n2, n1, n1, n2, n1, n1, n1, n1, n1, n2, n1, n2, n2, n1, n1, + n1, n1, n1, n2, n5, n2, n2, n1, n1, n3, n3, n5, n2, n5, n2, n2, n3, + n3, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n5, + n1, n1, n1, n1, n1, n1, n3, n3, n5, n2, n2, n3, n3, n1, n1, n1, n1, + n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, + n1, n1, n3, n3, n3, n5, n3, n3, n3, n1, n1, n1, n1, n1, n3, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + }, +} + +local bc_mushroom_21 = { + size = {y = 21, x = 19, z = 19}, + center_pos = {x=9, y=0, z=9}, + data = { + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, n2, n3, + n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, + n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, + n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n5, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n3, n3, n5, n5, n5, n5, n2, n3, n3, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n3, n3, n3, n3, n5, n3, n3, n3, n3, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n2, n1, n1, n2, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n2, n1, n1, n2, n1, n5, n2, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n2, n1, n5, n2, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n2, n1, n5, n2, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, n2, n1, n1, n2, n1, n5, + n2, n3, n3, n3, n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, n2, n5, n2, + n2, n5, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, + n3, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, + n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, + n5, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n5, n1, n2, n2, + n1, n1, n5, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n5, n1, + n2, n2, n1, n1, n5, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, + n5, n1, n2, n2, n1, n2, n5, n1, n5, n1, n1, n1, n1, n1, n1, n1, n3, + n5, n2, n5, n1, n2, n2, n1, n2, n5, n2, n5, n3, n1, n1, n1, n1, n1, + n1, n3, n3, n3, n5, n2, n2, n2, n5, n2, n5, n3, n3, n3, n1, n1, n1, + n1, n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n2, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n2, n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n5, n1, n2, n1, n1, n1, n2, n2, n2, n2, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n5, n1, n2, n1, n1, n1, n2, n2, n2, n2, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n5, n1, n2, n1, n1, n1, n2, n2, n2, n2, + n1, n1, n1, n1, n1, n1, n3, n3, n2, n5, n1, n2, n1, n1, n1, n2, n2, + n2, n2, n3, n3, n1, n1, n1, n1, n3, n3, n3, n5, n2, n2, n5, n5, n2, + n2, n2, n2, n3, n3, n3, n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, n4, + n4, n4, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, + n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n2, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, + n2, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n2, n1, + n2, n1, n2, n1, n1, n1, n1, n1, n1, n2, n1, n1, n2, n1, n1, n1, n2, + n2, n1, n2, n5, n2, n1, n1, n1, n1, n1, n1, n2, n1, n1, n2, n1, n1, + n1, n2, n2, n2, n2, n5, n2, n1, n1, n1, n1, n1, n1, n2, n1, n1, n2, + n1, n1, n1, n2, n2, n2, n2, n5, n2, n1, n1, n1, n1, n3, n3, n2, n1, + n1, n2, n1, n1, n5, n2, n2, n2, n2, n5, n2, n3, n3, n1, n1, n3, n3, + n3, n2, n2, n2, n2, n5, n4, n2, n2, n2, n2, n5, n3, n3, n3, n1, n1, + n1, n1, n3, n3, n3, n3, n4, n4, n4, n4, n4, n3, n3, n3, n3, n1, n1, + n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, + n1, n1, n1, n1, n5, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n2, n1, n1, n1, n1, n5, n5, n1, n1, n1, n1, n2, n5, n1, n1, n1, + n1, n1, n1, n2, n1, n1, n1, n1, n5, n5, n1, n1, n1, n1, n2, n5, n1, + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n5, n5, n1, n2, n1, n1, n2, + n5, n1, n1, n1, n3, n2, n1, n2, n1, n1, n1, n2, n4, n5, n1, n2, n1, + n1, n2, n5, n3, n1, n1, n3, n3, n2, n2, n5, n5, n2, n4, n4, n4, n2, + n2, n2, n2, n2, n3, n3, n1, n1, n1, n3, n3, n3, n3, n4, n4, n4, n4, + n4, n4, n4, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, + n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, + n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n2, n2, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, n4, n4, n4, n2, n2, n2, + n1, n1, n2, n1, n1, n1, n1, n5, n5, n1, n1, n1, n1, n4, n4, n4, n2, + n2, n2, n1, n1, n2, n1, n1, n1, n1, n5, n5, n1, n1, n5, n2, n4, n4, + n4, n2, n2, n2, n1, n1, n2, n1, n1, n1, n1, n5, n5, n1, n1, n5, n2, + n4, n4, n4, n2, n2, n2, n1, n5, n2, n1, n1, n3, n3, n5, n5, n1, n1, + n5, n2, n4, n4, n4, n2, n2, n2, n1, n5, n2, n3, n3, n3, n3, n3, n5, + n5, n2, n5, n4, n4, n4, n4, n4, n2, n2, n2, n5, n3, n3, n3, n1, n1, + n3, n3, n3, n4, n4, n4, n4, n4, n4, n4, n4, n4, n3, n3, n3, n1, n1, + n1, n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, + n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n4, n4, + n4, n1, n1, n1, n1, n1, n1, n2, n1, n1, n2, n1, n1, n1, n1, n1, n5, + n4, n4, n4, n1, n1, n1, n1, n1, n1, n2, n1, n1, n2, n1, n1, n1, n5, + n1, n5, n4, n4, n4, n2, n1, n1, n1, n1, n1, n2, n1, n1, n2, n1, n1, + n1, n5, n1, n5, n4, n4, n4, n2, n1, n1, n1, n2, n1, n2, n1, n1, n2, + n1, n1, n1, n5, n1, n5, n4, n4, n4, n2, n1, n1, n1, n2, n1, n2, n1, + n1, n2, n1, n1, n1, n5, n1, n5, n4, n4, n4, n2, n1, n1, n1, n2, n1, + n2, n1, n3, n2, n1, n1, n1, n5, n2, n4, n4, n4, n4, n4, n5, n1, n1, + n2, n1, n2, n3, n3, n3, n2, n2, n5, n5, n4, n4, n4, n4, n4, n4, n4, + n2, n2, n2, n2, n3, n3, n1, n1, n3, n3, n3, n4, n4, n4, n4, n4, n4, + n4, n4, n4, n3, n3, n3, n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, n3, + n3, n3, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, + n3, n3, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, + n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n4, n4, n4, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n4, n4, n4, n5, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n4, n4, n4, n5, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n4, n4, n4, n5, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n2, n4, n4, n4, n5, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n2, n4, n4, n4, + n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n2, n4, + n4, n4, n5, n1, n1, n1, n1, n1, n1, n1, n3, n3, n2, n2, n1, n1, n1, + n2, n4, n4, n4, n5, n1, n1, n1, n1, n2, n3, n3, n3, n3, n3, n2, n2, + n5, n5, n4, n4, n4, n4, n4, n2, n5, n5, n2, n3, n3, n3, n1, n1, n3, + n3, n3, n4, n4, n4, n4, n4, n4, n4, n4, n4, n3, n3, n3, n1, n1, n1, + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n2, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n2, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n5, n2, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n5, n2, n1, n1, n1, n1, n1, n1, n5, n1, + n1, n1, n3, n5, n1, n1, n1, n1, n1, n5, n4, n2, n1, n1, n1, n1, n1, + n5, n3, n1, n1, n3, n3, n5, n5, n2, n5, n2, n4, n4, n4, n2, n2, n2, + n2, n5, n3, n3, n1, n1, n1, n3, n3, n3, n3, n4, n4, n4, n4, n4, n4, + n4, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, n3, n3, + n3, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, + n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n5, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, + n5, n5, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n5, n1, n1, n1, n1, + n1, n2, n5, n5, n1, n1, n1, n5, n3, n3, n1, n1, n3, n3, n3, n5, n2, + n5, n2, n2, n4, n5, n5, n2, n2, n5, n3, n3, n3, n1, n1, n1, n1, n3, + n3, n3, n3, n4, n4, n4, n4, n4, n3, n3, n3, n3, n1, n1, n1, n1, n1, + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, + n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, + n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n2, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n2, n5, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n2, n5, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n2, n5, n1, n2, n2, n1, n1, n1, n1, n1, n1, + n1, n1, n3, n3, n2, n1, n1, n1, n2, n5, n2, n2, n2, n1, n2, n3, n3, + n1, n1, n1, n1, n3, n3, n3, n5, n2, n5, n2, n5, n2, n2, n2, n5, n3, + n3, n3, n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, n4, n4, n4, n3, n3, + n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, n3, n3, + n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, + n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n5, n1, n1, n1, n2, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n5, n1, n5, n1, n2, n1, n2, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n5, n1, n5, n1, n2, n1, n2, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n5, n1, n5, n1, n2, n1, n2, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n5, n1, n2, n1, n2, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n5, n1, n2, n2, + n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n2, n5, n1, n5, n1, + n2, n2, n2, n1, n5, n5, n3, n1, n1, n1, n1, n1, n1, n3, n3, n3, n2, + n5, n2, n2, n2, n2, n5, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n3, + n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, + n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n2, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n2, n5, n2, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n3, n3, n3, n2, n5, n2, n2, n1, n1, n2, n3, n3, n3, n1, n1, + n1, n1, n1, n1, n3, n3, n3, n3, n5, n2, n2, n5, n5, n3, n3, n3, n3, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n5, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, + n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, + n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n5, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n5, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n5, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n5, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n5, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n5, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n5, n1, n1, n1, n5, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n5, n5, n1, + n2, n5, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, + n3, n2, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n2, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n3, n3, n3, n2, n3, n3, n3, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, n3, n3, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n3, + n3, n3, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + } +} + +df_primordial_items.get_primordial_mushroom = function() + local rand = math.random() + if rand < 0.3 then + return bc_mushroom_3 + elseif rand < 0.7 then + return bc_mushroom_5 + elseif rand < 0.975 then + return bc_mushroom_9 + end + return bc_mushroom_21 +end + +minetest.register_node("df_primordial_items:mush_sapling", { + description = S("Primordial Mushroom Spawn"), + _doc_items_longdesc = df_primordial_items.doc.giant_mushroom_desc, + _doc_items_usagehelp = df_primordial_items.doc.giant_mushroom_usage, + tiles = {"dfcaverns_mush_sapling.png"}, + inventory_image = "dfcaverns_mush_sapling.png", + wield_image = "dfcaverns_mush_sapling.png", + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1, sapling = 1, light_sensitive_fungus = 11}, + selection_box = { + type = "fixed", + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} + }, + paramtype = "light", + drawtype = "plantlike", + buildable_to = true, + walkable = false, + is_ground_content = false, + sounds = default.node_sound_leaves_defaults(), + use_texture_alpha = true, + sunlight_propagates = true, + on_construct = function(pos) + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") == 0 then + return + end + minetest.get_node_timer(pos):start(math.random( + df_trees.config.tree_min_growth_delay, + df_trees.config.tree_max_growth_delay)) + end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() + end, + on_timer = function(pos, elapsed) + if df_farming and df_farming.kill_if_sunlit(pos) then + return + end + local mushroom = df_primordial_items.get_primordial_mushroom() + local rotation = (math.random(1,4)-1)*90 + minetest.set_node(pos, {name="air"}) -- clear sapling so mushroom can replace it + mapgen_helper.place_schematic(pos, mushroom, rotation) + end, +}) + diff --git a/df_primordial_items/settingtypes.txt b/df_primordial_items/settingtypes.txt new file mode 100644 index 0000000..6a5ed3d --- /dev/null +++ b/df_primordial_items/settingtypes.txt @@ -0,0 +1,5 @@ +dfcaverns_mycelium_min_growth_delay (Minimum mycelium growth delay) int 240 +dfcaverns_mycelium_max_growth_delay (Maximum mycelium growth delay) int 400 + +dfcaverns_jungle_min_growth_delay (Minimum growth delay for large jungle plants) int 300 +dfcaverns_jungle_max_growth_delay (Maximum growth delay for large jungle plants) int 1500 diff --git a/df_primordial_items/textures/dfcaverns_jungle_fern_01.png b/df_primordial_items/textures/dfcaverns_jungle_fern_01.png new file mode 100644 index 0000000..bf07eec Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_fern_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_fern_02.png b/df_primordial_items/textures/dfcaverns_jungle_fern_02.png new file mode 100644 index 0000000..1501d75 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_fern_02.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_fern_03.png b/df_primordial_items/textures/dfcaverns_jungle_fern_03.png new file mode 100644 index 0000000..d7c2741 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_fern_03.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_fern_bark.png b/df_primordial_items/textures/dfcaverns_jungle_fern_bark.png new file mode 100644 index 0000000..7d53f1a Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_fern_bark.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_fern_leaves_01.png b/df_primordial_items/textures/dfcaverns_jungle_fern_leaves_01.png new file mode 100644 index 0000000..ccae9c7 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_fern_leaves_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_fern_stem.png b/df_primordial_items/textures/dfcaverns_jungle_fern_stem.png new file mode 100644 index 0000000..7612d59 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_fern_stem.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_flower_01.png b/df_primordial_items/textures/dfcaverns_jungle_flower_01.png new file mode 100644 index 0000000..726ea3a Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_flower_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_glow_plant_01.png b/df_primordial_items/textures/dfcaverns_jungle_glow_plant_01.png new file mode 100644 index 0000000..f90f4fc Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_glow_plant_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_glow_plant_02.png b/df_primordial_items/textures/dfcaverns_jungle_glow_plant_02.png new file mode 100644 index 0000000..f6dfd61 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_glow_plant_02.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_grass_01.png b/df_primordial_items/textures/dfcaverns_jungle_grass_01.png new file mode 100644 index 0000000..baad3ca Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_grass_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_grass_02.png b/df_primordial_items/textures/dfcaverns_jungle_grass_02.png new file mode 100644 index 0000000..fc439ff Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_grass_02.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_grass_03.png b/df_primordial_items/textures/dfcaverns_jungle_grass_03.png new file mode 100644 index 0000000..537d3b5 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_grass_03.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_ivy_01.png b/df_primordial_items/textures/dfcaverns_jungle_ivy_01.png new file mode 100644 index 0000000..b6fbe1b Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_ivy_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_leaves_01.png b/df_primordial_items/textures/dfcaverns_jungle_leaves_01.png new file mode 100644 index 0000000..d539030 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_leaves_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_leaves_02.png b/df_primordial_items/textures/dfcaverns_jungle_leaves_02.png new file mode 100644 index 0000000..3c2889d Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_leaves_02.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_mushroom_01.png b/df_primordial_items/textures/dfcaverns_jungle_mushroom_01.png new file mode 100644 index 0000000..082886e Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_mushroom_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_mushroom_02.png b/df_primordial_items/textures/dfcaverns_jungle_mushroom_02.png new file mode 100644 index 0000000..e388ecb Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_mushroom_02.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_mushroom_stem.png b/df_primordial_items/textures/dfcaverns_jungle_mushroom_stem.png new file mode 100644 index 0000000..dfd030a Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_mushroom_stem.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_mushroom_stem_02.png b/df_primordial_items/textures/dfcaverns_jungle_mushroom_stem_02.png new file mode 100644 index 0000000..771741e Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_mushroom_stem_02.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_mushroom_top_01.png b/df_primordial_items/textures/dfcaverns_jungle_mushroom_top_01.png new file mode 100644 index 0000000..f05fa63 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_mushroom_top_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_mushroom_top_02.png b/df_primordial_items/textures/dfcaverns_jungle_mushroom_top_02.png new file mode 100644 index 0000000..d3b081f Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_mushroom_top_02.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_plant_grass_node_01.png b/df_primordial_items/textures/dfcaverns_jungle_plant_grass_node_01.png new file mode 100644 index 0000000..38366e9 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_plant_grass_node_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_plant_matter_01.png b/df_primordial_items/textures/dfcaverns_jungle_plant_matter_01.png new file mode 100644 index 0000000..b2809be Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_plant_matter_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_plant_packed_roots_01.png b/df_primordial_items/textures/dfcaverns_jungle_plant_packed_roots_01.png new file mode 100644 index 0000000..9636aad Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_plant_packed_roots_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_root_01.png b/df_primordial_items/textures/dfcaverns_jungle_root_01.png new file mode 100644 index 0000000..a56f066 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_root_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_root_02.png b/df_primordial_items/textures/dfcaverns_jungle_root_02.png new file mode 100644 index 0000000..beab246 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_root_02.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_sapling.png b/df_primordial_items/textures/dfcaverns_jungle_sapling.png new file mode 100644 index 0000000..5447e37 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_sapling.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_thorns_01.png b/df_primordial_items/textures/dfcaverns_jungle_thorns_01.png new file mode 100644 index 0000000..243b1f6 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_thorns_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_wood_01.png b/df_primordial_items/textures/dfcaverns_jungle_wood_01.png new file mode 100644 index 0000000..38226f3 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_wood_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_wood_02.png b/df_primordial_items/textures/dfcaverns_jungle_wood_02.png new file mode 100644 index 0000000..5b633df Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_wood_02.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_wood_03.png b/df_primordial_items/textures/dfcaverns_jungle_wood_03.png new file mode 100644 index 0000000..f119bf0 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_wood_03.png differ diff --git a/df_primordial_items/textures/dfcaverns_jungle_wood_04.png b/df_primordial_items/textures/dfcaverns_jungle_wood_04.png new file mode 100644 index 0000000..efe9816 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_jungle_wood_04.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_cap.png b/df_primordial_items/textures/dfcaverns_mush_cap.png new file mode 100644 index 0000000..fcd2756 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_cap.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_diced_giant_mushroom.png b/df_primordial_items/textures/dfcaverns_mush_diced_giant_mushroom.png new file mode 100644 index 0000000..65a5f32 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_diced_giant_mushroom.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_giant_hypha.png b/df_primordial_items/textures/dfcaverns_mush_giant_hypha.png new file mode 100644 index 0000000..246e3f1 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_giant_hypha.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_gills.png b/df_primordial_items/textures/dfcaverns_mush_gills.png new file mode 100644 index 0000000..6201aff Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_gills.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_gills_glow.png b/df_primordial_items/textures/dfcaverns_mush_gills_glow.png new file mode 100644 index 0000000..b2ebe58 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_gills_glow.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_glownode.png b/df_primordial_items/textures/dfcaverns_mush_glownode.png new file mode 100644 index 0000000..95488e0 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_glownode.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_grass_01.png b/df_primordial_items/textures/dfcaverns_mush_grass_01.png new file mode 100644 index 0000000..b2a8406 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_grass_01.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_grass_02.png b/df_primordial_items/textures/dfcaverns_mush_grass_02.png new file mode 100644 index 0000000..7e26d5c Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_grass_02.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_mycelial_fibers.png b/df_primordial_items/textures/dfcaverns_mush_mycelial_fibers.png new file mode 100644 index 0000000..e3f53a3 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_mycelial_fibers.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_orb.png b/df_primordial_items/textures/dfcaverns_mush_orb.png new file mode 100644 index 0000000..f44413a Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_orb.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_orb_vert.png b/df_primordial_items/textures/dfcaverns_mush_orb_vert.png new file mode 100644 index 0000000..2f017b7 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_orb_vert.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_pods.png b/df_primordial_items/textures/dfcaverns_mush_pods.png new file mode 100644 index 0000000..2e4a9c7 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_pods.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_sapling.png b/df_primordial_items/textures/dfcaverns_mush_sapling.png new file mode 100644 index 0000000..bf3d77c Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_sapling.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_shaft_side.png b/df_primordial_items/textures/dfcaverns_mush_shaft_side.png new file mode 100644 index 0000000..8264c98 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_shaft_side.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_shaft_top.png b/df_primordial_items/textures/dfcaverns_mush_shaft_top.png new file mode 100644 index 0000000..d6b43fb Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_shaft_top.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_soil.png b/df_primordial_items/textures/dfcaverns_mush_soil.png new file mode 100644 index 0000000..84bee31 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_soil.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_stalk_side.png b/df_primordial_items/textures/dfcaverns_mush_stalk_side.png new file mode 100644 index 0000000..317ada7 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_stalk_side.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_stalk_top.png b/df_primordial_items/textures/dfcaverns_mush_stalk_top.png new file mode 100644 index 0000000..6e7123c Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_stalk_top.png differ diff --git a/df_primordial_items/textures/dfcaverns_mush_stalks.png b/df_primordial_items/textures/dfcaverns_mush_stalks.png new file mode 100644 index 0000000..7b4a228 Binary files /dev/null and b/df_primordial_items/textures/dfcaverns_mush_stalks.png differ diff --git a/df_primordial_items/textures/license.txt b/df_primordial_items/textures/license.txt new file mode 100644 index 0000000..068a037 --- /dev/null +++ b/df_primordial_items/textures/license.txt @@ -0,0 +1,10 @@ +All primordial item textures not explicitly listed here were created by ClockGen and licensed under the CC BY 4.0 + +Created by FaceDeer and also licened under CC BY 4.0 (as well as CC0 public domain): +dfcaverns_mush_diced_giant_mushroom.png +dfcaverns_mush_giant_hypha.png +dfcaverns_mush_sapling.png +dfcaverns_mush_mycelial_fibers.png + +From Minetest default mod: +dfcaverns_jungle_sapling.png \ No newline at end of file diff --git a/df_trees/black_cap.lua b/df_trees/black_cap.lua index 0a9905e..36f057e 100644 --- a/df_trees/black_cap.lua +++ b/df_trees/black_cap.lua @@ -8,7 +8,7 @@ minetest.register_node("df_trees:black_cap_stem", { _doc_items_longdesc = df_trees.doc.black_cap_desc, _doc_items_usagehelp = df_trees.doc.black_cap_usage, tiles = {"dfcaverns_black_cap_top.png","dfcaverns_black_cap_top.png","dfcaverns_black_cap_side.png",}, - is_ground_content = true, + is_ground_content = false, groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, sounds = default.node_sound_wood_defaults(), }) @@ -19,7 +19,7 @@ minetest.register_node("df_trees:black_cap", { _doc_items_longdesc = df_trees.doc.black_cap_desc, _doc_items_usagehelp = df_trees.doc.black_cap_usage, tiles = {"dfcaverns_black_cap_top.png","dfcaverns_black_cap_top.png","dfcaverns_black_cap_side.png^[transformR90",}, - is_ground_content = true, + is_ground_content = false, groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, sounds = default.node_sound_wood_defaults(), }) @@ -30,7 +30,7 @@ minetest.register_node("df_trees:black_cap_gills", { _doc_items_longdesc = df_trees.doc.black_cap_desc, _doc_items_usagehelp = df_trees.doc.black_cap_usage, tiles = {"dfcaverns_black_cap_gills.png"}, - is_ground_content = true, + is_ground_content = false, groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, sounds = default.node_sound_leaves_defaults(), drawtype = "plantlike", @@ -143,6 +143,7 @@ minetest.register_node("df_trees:black_cap_sapling", { paramtype = "light", sunlight_propagates = true, walkable = false, + is_ground_content = false, floodable = true, selection_box = { type = "fixed", @@ -153,9 +154,15 @@ minetest.register_node("df_trees:black_cap_sapling", { sounds = default.node_sound_leaves_defaults(), on_construct = function(pos) - minetest.get_node_timer(pos):start(math.random( - df_trees.config.black_cap_delay_multiplier*df_trees.config.tree_min_growth_delay, - df_trees.config.black_cap_delay_multiplier*df_trees.config.tree_max_growth_delay)) + local below_node_name = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name + if minetest.get_item_group(below_node_name, "soil") > 0 or minetest.get_item_group(below_node_name, "coal") > 0 then + minetest.get_node_timer(pos):start(math.random( + df_trees.config.black_cap_delay_multiplier*df_trees.config.tree_min_growth_delay, + df_trees.config.black_cap_delay_multiplier*df_trees.config.tree_max_growth_delay)) + end + end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() end, on_timer = function(pos) diff --git a/df_trees/blood_thorn.lua b/df_trees/blood_thorn.lua index 2c21a37..12619fc 100644 --- a/df_trees/blood_thorn.lua +++ b/df_trees/blood_thorn.lua @@ -39,6 +39,7 @@ minetest.register_node("df_trees:blood_thorn", { groups = {choppy = 3, tree = 1, flammable = 2, light_sensitive_fungus = 11}, _dfcaverns_dead_node = "df_trees:blood_thorn_dead", sounds = default.node_sound_wood_defaults(), + is_ground_content = false, on_place = minetest.rotate_node, after_dig_node = blood_thorn_after_dig, }) @@ -53,6 +54,7 @@ minetest.register_node("df_trees:blood_thorn_dead", { paramtype = "light", groups = {choppy = 3, tree = 1, flammable = 2}, sounds = default.node_sound_wood_defaults(), + is_ground_content = false, on_place = minetest.rotate_node, after_dig_node = blood_thorn_after_dig, }) @@ -74,6 +76,7 @@ minetest.register_node("df_trees:blood_thorn_spike", { sounds = default.node_sound_wood_defaults(), drawtype = "nodebox", climbable = true, + is_ground_content = false, damage_per_second = 1, paramtype = "light", paramtype2 = "facedir", @@ -103,6 +106,7 @@ minetest.register_node("df_trees:blood_thorn_spike_dead", { sounds = default.node_sound_wood_defaults(), drawtype = "nodebox", climbable = true, + is_ground_content = false, paramtype = "light", paramtype2 = "facedir", node_box = { @@ -181,6 +185,11 @@ local max_bloodthorn_height = function(pos) end function df_trees.grow_blood_thorn(pos, node) + if df_farming and df_farming.kill_if_sunlit(pos) then + return + end + + -- node is tipped over if node.param2 >= 4 then return end diff --git a/df_trees/config.lua b/df_trees/config.lua index a97cd5e..60f4d0f 100644 --- a/df_trees/config.lua +++ b/df_trees/config.lua @@ -7,11 +7,11 @@ local print_settingtypes = false local function setting(stype, name, default, description) local value if stype == "bool" then - value = minetest.setting_getbool(CONFIG_FILE_PREFIX..name) + value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name, default) elseif stype == "string" then - value = minetest.setting_get(CONFIG_FILE_PREFIX..name) + value = minetest.settings:get(CONFIG_FILE_PREFIX..name) elseif stype == "int" or stype == "float" then - value = tonumber(minetest.setting_get(CONFIG_FILE_PREFIX..name)) + value = tonumber(minetest.settings:get(CONFIG_FILE_PREFIX..name)) end if value == nil then value = default diff --git a/df_trees/depends.txt b/df_trees/depends.txt deleted file mode 100644 index 9542636..0000000 --- a/df_trees/depends.txt +++ /dev/null @@ -1,7 +0,0 @@ -default -intllib? -doc? -moreblocks? -stairs? -vessels? -basic_materials? \ No newline at end of file diff --git a/df_trees/description.txt b/df_trees/description.txt deleted file mode 100644 index 9cc6910..0000000 --- a/df_trees/description.txt +++ /dev/null @@ -1 +0,0 @@ -Adds various types of underground fungal "trees". Light kills their saplings, they only grow in the dark. \ No newline at end of file diff --git a/df_trees/fungiwood.lua b/df_trees/fungiwood.lua index 3de93e5..013283f 100644 --- a/df_trees/fungiwood.lua +++ b/df_trees/fungiwood.lua @@ -115,6 +115,7 @@ minetest.register_node("df_trees:fungiwood_sapling", { paramtype = "light", sunlight_propagates = true, walkable = false, + is_ground_content = false, floodable = true, selection_box = { type = "fixed", @@ -125,15 +126,21 @@ minetest.register_node("df_trees:fungiwood_sapling", { sounds = default.node_sound_leaves_defaults(), on_construct = function(pos) - local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0})) - if minetest.get_item_group(below_node.name, "soil") > 0 then - minetest.get_node_timer(pos):start(math.random( - df_trees.config.fungiwood_delay_multiplier*df_trees.config.tree_min_growth_delay, - df_trees.config.fungiwood_delay_multiplier*df_trees.config.tree_max_growth_delay)) + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") == 0 then + return end + minetest.get_node_timer(pos):start(math.random( + df_trees.config.fungiwood_delay_multiplier*df_trees.config.tree_min_growth_delay, + df_trees.config.fungiwood_delay_multiplier*df_trees.config.tree_max_growth_delay)) + end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() end, on_timer = function(pos) + if df_farming and df_farming.kill_if_sunlit(pos) then + return + end minetest.set_node(pos, {name="air"}) df_trees.spawn_fungiwood(pos) end, diff --git a/df_trees/goblin_cap.lua b/df_trees/goblin_cap.lua index dd71bb9..acb503d 100644 --- a/df_trees/goblin_cap.lua +++ b/df_trees/goblin_cap.lua @@ -8,7 +8,7 @@ minetest.register_node("df_trees:goblin_cap_stem", { _doc_items_longdesc = df_trees.doc.goblin_cap_desc, _doc_items_usagehelp = df_trees.doc.goblin_cap_usage, tiles = {"dfcaverns_goblin_cap_stem.png"}, - is_ground_content = true, + is_ground_content = false, groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, goblin_cap = 1}, sounds = df_trees.node_sound_tree_soft_fungus_defaults(), }) @@ -19,7 +19,7 @@ minetest.register_node("df_trees:goblin_cap", { _doc_items_longdesc = df_trees.doc.goblin_cap_desc, _doc_items_usagehelp = df_trees.doc.goblin_cap_usage, tiles = {"dfcaverns_goblin_cap.png"}, - is_ground_content = true, + is_ground_content = false, groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, goblin_cap = 1}, sounds = df_trees.node_sound_tree_soft_fungus_defaults(), }) @@ -30,7 +30,7 @@ minetest.register_node("df_trees:goblin_cap_gills", { _doc_items_longdesc = df_trees.doc.goblin_cap_desc, _doc_items_usagehelp = df_trees.doc.goblin_cap_usage, tiles = {"dfcaverns_goblin_cap_gills.png"}, - is_ground_content = true, + is_ground_content = false, groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, goblin_cap = 1}, sounds = default.node_sound_leaves_defaults(), drawtype = "plantlike", @@ -131,6 +131,57 @@ minetest.register_craft({ burntime = 2, }) +local big_goblin_cap_schem = dofile(MP.."/schematics/goblin_cap_big.lua") +local big_goblin_cap_hut_schem = dofile(MP.."/schematics/goblin_cap_big_hut.lua") +local bigger_goblin_cap_schem = dofile(MP.."/schematics/goblin_cap_bigger.lua") +local bigger_goblin_cap_hut_schem = dofile(MP.."/schematics/goblin_cap_bigger_hut.lua") + +-- The hut has a chest and furnace near pos, use this to initialize it +local chest_on_construct = minetest.registered_items["default:chest"].on_construct +local furnace_on_construct = minetest.registered_items["default:furnace"].on_construct +local init_hut = function(pos) + local chest_pos = minetest.find_node_near({x=pos.x, y=pos.y+1, z=pos.z}, 2, "default:chest") + if chest_pos then + chest_on_construct(chest_pos) + local inv = minetest.get_inventory({type="node", pos=chest_pos}) + inv:add_item("main", "default:apple 3") + inv:add_item("main", "default:gold_ingot ".. math.random(1,5)) + end + local furnace_pos = minetest.find_node_near({x=pos.x, y=pos.y+1, z=pos.z}, 2, "default:furnace") + if furnace_pos then + furnace_on_construct(furnace_pos) + end +end +local init_vessels +if minetest.get_modpath("vessels") then + local vessels_on_construct = minetest.registered_items["vessels:shelf"].on_construct + init_vessels = function(pos) + local vessel_pos = minetest.find_node_near({x=pos.x, y=pos.y+1, z=pos.z}, 2, "vessels:shelf") + if vessel_pos then + vessels_on_construct(vessel_pos) + local inv = minetest.get_inventory({type="node", pos=vessel_pos}) + inv:add_item("vessels", "df_trees:glowing_bottle_red "..math.random(50,99)) + inv:add_item("vessels", "df_trees:glowing_bottle_green "..math.random(50,99)) + inv:add_item("vessels", "df_trees:glowing_bottle_cyan "..math.random(40,99)) + inv:add_item("vessels", "df_trees:glowing_bottle_golden "..math.random(30,99)) + end + end +end + +--local debug_test_hut = function(pos) +-- minetest.set_node(pos, {name="air"}) +-- minetest.after(5, init_hut, pos) +-- if math.random() < 0.5 then +-- mapgen_helper.place_schematic(pos, big_goblin_cap_hut_schem, "random") +-- else +-- if init_vessels then +-- minetest.after(5, init_vessels, pos) +-- end +-- mapgen_helper.place_schematic(pos, bigger_goblin_cap_hut_schem, "random") +-- end +--end + + -- sapling minetest.register_node("df_trees:goblin_cap_sapling", { description = S("Goblin Cap Spawn"), @@ -143,6 +194,7 @@ minetest.register_node("df_trees:goblin_cap_sapling", { wield_image = "dfcaverns_goblin_cap_sapling.png", paramtype = "light", sunlight_propagates = true, + is_ground_content = false, walkable = false, floodable = true, selection_box = { @@ -154,17 +206,33 @@ minetest.register_node("df_trees:goblin_cap_sapling", { sounds = default.node_sound_leaves_defaults(), on_construct = function(pos) - local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0})) - if minetest.get_item_group(below_node.name, "soil") > 0 then - minetest.get_node_timer(pos):start(math.random( - df_trees.config.goblin_cap_delay_multiplier*df_trees.config.tree_min_growth_delay, - df_trees.config.goblin_cap_delay_multiplier*df_trees.config.tree_max_growth_delay)) + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") == 0 then + return end + minetest.get_node_timer(pos):start(math.random( + df_trees.config.goblin_cap_delay_multiplier*df_trees.config.tree_min_growth_delay, + df_trees.config.goblin_cap_delay_multiplier*df_trees.config.tree_max_growth_delay)) + end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() end, on_timer = function(pos) + if df_farming and df_farming.kill_if_sunlit(pos) then + return + end + minetest.set_node(pos, {name="air"}) - df_trees.spawn_goblin_cap(pos) + if minetest.find_node_near({x=pos.x, y=pos.y-1, z=pos.z}, 1, {"group:straw"}) then + if math.random() < 0.5 then + mapgen_helper.place_schematic(pos, big_goblin_cap_schem) + else + mapgen_helper.place_schematic(pos, bigger_goblin_cap_schem) + end + return + else + df_trees.spawn_goblin_cap(pos) + end end, }) @@ -172,8 +240,35 @@ local c_stem = minetest.get_content_id("df_trees:goblin_cap_stem") local c_cap = minetest.get_content_id("df_trees:goblin_cap") local c_gills = minetest.get_content_id("df_trees:goblin_cap_gills") +-- If the farming mod is installed, add the "straw" group to farming straw. +-- This way we just need to check for group:straw to get cave straw as well, without +-- needing a df_farming dependency for this mod. +if minetest.get_modpath("farming") then + local straw_def = minetest.registered_items["farming:straw"] + if straw_def then + local new_groups = {} + for group, val in pairs(straw_def.groups) do + new_groups[group] = val + end + new_groups.straw = 1 + minetest.override_item("farming:straw", { + groups = new_groups + }) + end +end + df_trees.spawn_goblin_cap = function(pos) + if math.random() < 0.1 then + if math.random() < 0.5 then + mapgen_helper.place_schematic(pos, big_goblin_cap_schem) + else + mapgen_helper.place_schematic(pos, bigger_goblin_cap_schem) + end + return + end + local x, y, z = pos.x, pos.y, pos.z + local stem_height = math.random(1,3) local cap_radius = math.random(3,6) local maxy = y + stem_height + 3 @@ -193,7 +288,28 @@ df_trees.spawn_goblin_cap = function(pos) vm:update_map() end -df_trees.spawn_goblin_cap_vm = function(vi, area, data) +df_trees.spawn_goblin_cap_vm = function(vi, area, data, data_param2) + if math.random() < 0.1 then + local pos = area:position(vi) + if math.random() < 0.5 then + mapgen_helper.place_schematic_on_data(data, data_param2, area, pos, big_goblin_cap_schem) + elseif math.random() < 0.9 then + mapgen_helper.place_schematic_on_data(data, data_param2, area, pos, bigger_goblin_cap_schem) + else + -- easter egg - every once in a while (0.5%), a mapgen Goblin cap is a Smurf house + minetest.after(5, init_hut, pos) + if math.random() < 0.5 then + mapgen_helper.place_schematic_on_data(data, data_param2, area, pos, big_goblin_cap_hut_schem) + else + if init_vessels then + minetest.after(5, init_vessels, pos) + end + mapgen_helper.place_schematic_on_data(data, data_param2, area, pos, bigger_goblin_cap_hut_schem) + end + end + return + end + local stem_height = math.random(1,3) local cap_radius = math.random(3,6) subterrane.giant_mushroom(vi, area, data, c_stem, c_cap, c_gills, stem_height, cap_radius) diff --git a/df_trees/mod.conf b/df_trees/mod.conf index c277cc2..be7544c 100644 --- a/df_trees/mod.conf +++ b/df_trees/mod.conf @@ -1,4 +1,4 @@ name = df_trees description = Adds various types of underground fungal "trees". Light kills their saplings, they only grow in the dark. depends = default -optional_depends = intllib, doc, moreblocks, stairs, vessels, basic_materials \ No newline at end of file +optional_depends = intllib, doc, moreblocks, stairs, vessels, basic_materials, farming, doors, beds, df_farming \ No newline at end of file diff --git a/df_trees/nether_cap.lua b/df_trees/nether_cap.lua index 5bbef57..3668883 100644 --- a/df_trees/nether_cap.lua +++ b/df_trees/nether_cap.lua @@ -8,8 +8,8 @@ minetest.register_node("df_trees:nether_cap_stem", { _doc_items_longdesc = df_trees.doc.nether_cap_desc, _doc_items_usagehelp = df_trees.doc.nether_cap_usage, tiles = {"dfcaverns_nether_cap_stem.png"}, - is_ground_content = true, - groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1}, + is_ground_content = false, + groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1, nether_cap = 1}, sounds = default.node_sound_wood_defaults(), }) @@ -19,8 +19,8 @@ minetest.register_node("df_trees:nether_cap", { _doc_items_longdesc = df_trees.doc.nether_cap_desc, _doc_items_usagehelp = df_trees.doc.nether_cap_usage, tiles = {"dfcaverns_nether_cap.png"}, - is_ground_content = true, - groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1 }, + is_ground_content = false, + groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1, nether_cap = 1}, sounds = default.node_sound_wood_defaults({ footstep = {name = "default_snow_footstep", gain = 0.2}, }), @@ -32,9 +32,9 @@ minetest.register_node("df_trees:nether_cap_gills", { _doc_items_longdesc = df_trees.doc.nether_cap_desc, _doc_items_usagehelp = df_trees.doc.nether_cap_usage, tiles = {"dfcaverns_nether_cap_gills.png"}, - is_ground_content = true, + is_ground_content = false, light_source = 6, - groups = {snappy = 3, leafdecay = 3, leaves = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1}, + groups = {snappy = 3, leafdecay = 3, leaves = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1, nether_cap = 1}, sounds = default.node_sound_leaves_defaults(), drawtype = "plantlike", paramtype = "light", @@ -103,6 +103,7 @@ minetest.register_node("df_trees:nether_cap_sapling", { paramtype = "light", sunlight_propagates = true, walkable = false, + is_ground_content = false, floodable = true, -- nether cap spawn aren't tough enough to freeze water yet selection_box = { type = "fixed", @@ -113,12 +114,24 @@ minetest.register_node("df_trees:nether_cap_sapling", { sounds = default.node_sound_leaves_defaults(), on_construct = function(pos) + local node_below_name = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name + if minetest.get_item_group(node_below_name, "cools_lava") == 0 or minetest.get_item_group(node_below_name, "nether_cap") > 0 then + return + end + minetest.get_node_timer(pos):start(math.random( df_trees.config.nether_cap_delay_multiplier*df_trees.config.tree_min_growth_delay, df_trees.config.nether_cap_delay_multiplier*df_trees.config.tree_max_growth_delay)) end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() + end, on_timer = function(pos) + if df_farming and df_farming.kill_if_sunlit(pos) then + return + end + minetest.set_node(pos, {name="air"}) df_trees.spawn_nether_cap(pos) end, diff --git a/df_trees/schematics/goblin_cap_big.lua b/df_trees/schematics/goblin_cap_big.lua new file mode 100644 index 0000000..181b979 --- /dev/null +++ b/df_trees/schematics/goblin_cap_big.lua @@ -0,0 +1,220 @@ +local n1 = { name = "air", prob = 0 } -- external air +local n2 = { name = "df_trees:goblin_cap" } +local n4 = { name = "df_trees:goblin_cap_gills" } +local n6 = { name = "df_trees:goblin_cap_stem" } + +return { + yslice_prob = {}, + size = {y = 9, x = 11, z = 11}, + center_pos = {x=5, y=2, z=5}, + data = { + -- z=0, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=5 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + -- z=0, y=6 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=7 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=1, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=5 + n1, n1, n2, n2, n2, n4, n2, n2, n2, n1, n1, + -- z=1, y=6 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + -- z=1, y=7 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=2, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=5 + n1, n2, n2, n4, n4, n4, n4, n4, n2, n2, n1, + -- z=2, y=6 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=2, y=7 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + -- z=2, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=3, y=0 + n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1, + -- z=3, y=1 + n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1, + -- z=3, y=2 + n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1, + -- z=3, y=3 + n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1, + -- z=3, y=4 + n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1, + -- z=3, y=5 + n1, n2, n4, n4, n6, n6, n6, n4, n4, n2, n1, + -- z=3, y=6 + n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1, + -- z=3, y=7 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=3, y=8 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + + -- z=4, y=0 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=4, y=1 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=4, y=2 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=4, y=3 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=4, y=4 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=4, y=5 + n1, n2, n4, n6, n6, n6, n6, n6, n4, n2, n1, + -- z=4, y=6 + n1, n1, n2, n2, n6, n6, n6, n2, n2, n1, n1, + -- z=4, y=7 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=4, y=8 + n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1, + + -- z=5, y=0 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=5, y=1 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=5, y=2 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=5, y=3 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=5, y=4 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=5, y=5 + n2, n4, n4, n6, n6, n6, n6, n6, n4, n4, n2, + -- z=5, y=6 + n1, n2, n2, n2, n6, n6, n6, n2, n2, n2, n1, + -- z=5, y=7 + n1, n1, n2, n2, n2, n6, n2, n2, n2, n1, n1, + -- z=5, y=8 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + + -- z=6, y=0 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=6, y=1 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=6, y=2 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=6, y=3 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=6, y=4 + n1, n1, n1, n6, n6, n6, n6, n6, n1, n1, n1, + -- z=6, y=5 + n1, n2, n4, n6, n6, n6, n6, n6, n4, n2, n1, + -- z=6, y=6 + n1, n1, n2, n2, n6, n6, n6, n2, n2, n1, n1, + -- z=6, y=7 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=6, y=8 + n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1, + + -- z=7, y=0 + n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1, + -- z=7, y=1 + n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1, + -- z=7, y=2 + n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1, + -- z=7, y=3 + n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1, + -- z=7, y=4 + n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1, + -- z=7, y=5 + n1, n2, n4, n4, n6, n6, n6, n4, n4, n2, n1, + -- z=7, y=6 + n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1, + -- z=7, y=7 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=7, y=8 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + + -- z=8, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=8, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=8, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=8, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=8, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=8, y=5 + n1, n2, n2, n4, n4, n4, n4, n4, n2, n2, n1, + -- z=8, y=6 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=8, y=7 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + -- z=8, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=9, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=9, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=9, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=9, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=9, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=9, y=5 + n1, n1, n2, n2, n2, n4, n2, n2, n2, n1, n1, + -- z=9, y=6 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + -- z=9, y=7 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=9, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=10, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=5 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + -- z=10, y=6 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=7 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, +} +} diff --git a/df_trees/schematics/goblin_cap_big_hut.lua b/df_trees/schematics/goblin_cap_big_hut.lua new file mode 100644 index 0000000..c04ca15 --- /dev/null +++ b/df_trees/schematics/goblin_cap_big_hut.lua @@ -0,0 +1,253 @@ +local n1 = { name = "air", prob = 0 } -- external air +local n2 = { name = "df_trees:goblin_cap" } +local n3 = {name = "stairs:slab_goblin_cap_stem_wood", param2 = 2} -- porch top +local n4 = { name = "df_trees:goblin_cap_gills" } +local n6 = { name = "df_trees:goblin_cap_stem", force_place=true } -- walls +local n7 = { name = "df_trees:goblin_cap_stem_wood", force_place=true } -- internal floor +local n8 = { name = "doors:door_wood_a", force_place=true } +local n9 = { name = "doors:hidden", force_place=true } +local n10 = { name = "default:furnace", param2 = 3, force_place=true } +local n11 = { name = "air", force_place=true } -- internal air +local n12 = { name = "beds:bed_bottom", force_place=true } +local n13 = { name = "df_trees:goblin_cap_stem", prob = 198, force_place=true } -- possible window holes +local n16 = { name = "default:chest", param2 = 3, force_place=true } +local n17 = { name = "beds:bed_top", force_place=true } +local n18 = { name = "default:torch_wall", param2 = 4, force_place=true } +local n19 = { name = "df_trees:goblin_cap_stem" } -- base + +local n20 = {name = "stairs:stair_goblin_cap_stem_wood", param2 = 1 } +local n21 = {name = "stairs:stair_goblin_cap_stem_wood", param2 = 3 } +local n22 = {name = "stairs:slab_goblin_cap_stem_wood", param2 = 22} + + + +if minetest.get_modpath("vessels") then + n18 = { name = "df_trees:glowing_bottle_red", force_place=true} +end + +if not minetest.get_modpath("doors") then + -- replace the door with air + n8 = n11 + n9 = n11 +end +if not minetest.get_modpath("beds") then + --replace the bed with air + n12 = n11 + n17 = n11 +end + +return { + yslice_prob = {}, + size = {y = 9, x = 11, z = 11}, + center_pos = {x=5, y=2, z=5}, + data = { + -- z=0, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=5 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + -- z=0, y=6 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=7 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=1, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=3 + n1, n1, n1, n1, n1, n11, n1, n1, n1, n1, n1, + -- z=1, y=4 + n1, n1, n1, n1, n1, n11, n1, n1, n1, n1, n1, + -- z=1, y=5 + n1, n1, n2, n2, n2, n4, n2, n2, n2, n1, n1, + -- z=1, y=6 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + -- z=1, y=7 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=2, y=0 + n1, n1, n1, n22, n1, n1, n1, n22, n1, n1, n1, + -- z=2, y=1 + n1, n1, n1, n1, n20, n1, n21, n1, n1, n1, n1, + -- z=2, y=2 + n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, + -- z=2, y=3 + n1, n1, n1, n1, n1, n11, n1, n1, n1, n1, n1, + -- z=2, y=4 + n1, n1, n1, n1, n1, n11, n1, n1, n1, n1, n1, + -- z=2, y=5 + n1, n2, n2, n4, n4, n4, n4, n4, n2, n2, n1, + -- z=2, y=6 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=2, y=7 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + -- z=2, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=3, y=0 + n1, n1, n1, n3, n19, n19, n19, n3, n1, n1, n1, + -- z=3, y=1 + n1, n1, n1, n1, n19, n19, n19, n1, n1, n1, n1, + -- z=3, y=2 + n1, n1, n1, n1, n6, n7, n6, n1, n1, n1, n1, + -- z=3, y=3 + n1, n1, n1, n1, n6, n8, n6, n1, n1, n1, n1, + -- z=3, y=4 + n1, n1, n1, n1, n6, n9, n6, n1, n1, n1, n1, + -- z=3, y=5 + n1, n2, n4, n4, n6, n6, n6, n4, n4, n2, n1, + -- z=3, y=6 + n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1, + -- z=3, y=7 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=3, y=8 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + + -- z=4, y=0 + n1, n1, n1, n19, n19, n19, n19, n19, n1, n1, n1, + -- z=4, y=1 + n1, n1, n1, n19, n19, n19, n19, n19, n1, n1, n1, + -- z=4, y=2 + n1, n1, n1, n6, n7, n7, n7, n6, n1, n1, n1, + -- z=4, y=3 + n1, n1, n1, n6, n10, n11, n11, n6, n1, n1, n1, + -- z=4, y=4 + n1, n1, n1, n6, n11, n11, n11, n6, n1, n1, n1, + -- z=4, y=5 + n1, n2, n4, n6, n11, n11, n11, n6, n4, n2, n1, + -- z=4, y=6 + n1, n1, n2, n2, n6, n6, n6, n2, n2, n1, n1, + -- z=4, y=7 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=4, y=8 + n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1, + + -- z=5, y=0 + n1, n1, n1, n19, n19, n19, n19, n19, n1, n1, n1, + -- z=5, y=1 + n1, n1, n1, n19, n19, n19, n19, n19, n1, n1, n1, + -- z=5, y=2 + n1, n1, n1, n6, n7, n7, n7, n6, n1, n1, n1, + -- z=5, y=3 + n1, n1, n1, n6, n11, n11, n12, n6, n1, n1, n1, + -- z=5, y=4 + n1, n1, n1, n13, n11, n11, n11, n13, n1, n1, n1, + -- z=5, y=5 + n2, n4, n4, n6, n11, n11, n11, n6, n4, n4, n2, + -- z=5, y=6 + n1, n2, n2, n2, n6, n11, n6, n2, n2, n2, n1, + -- z=5, y=7 + n1, n1, n2, n2, n2, n6, n2, n2, n2, n1, n1, + -- z=5, y=8 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + + -- z=6, y=0 + n1, n1, n1, n19, n19, n19, n19, n19, n1, n1, n1, + -- z=6, y=1 + n1, n1, n1, n19, n19, n19, n19, n19, n1, n1, n1, + -- z=6, y=2 + n1, n1, n1, n6, n7, n7, n7, n6, n1, n1, n1, + -- z=6, y=3 + n1, n1, n1, n6, n16, n11, n17, n6, n1, n1, n1, + -- z=6, y=4 + n1, n1, n1, n6, n18, n11, n11, n6, n1, n1, n1, + -- z=6, y=5 + n1, n2, n4, n6, n11, n11, n11, n6, n4, n2, n1, + -- z=6, y=6 + n1, n1, n2, n2, n6, n6, n6, n2, n2, n1, n1, + -- z=6, y=7 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=6, y=8 + n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1, + + -- z=7, y=0 + n1, n1, n1, n1, n19, n19, n19, n1, n1, n1, n1, + -- z=7, y=1 + n1, n1, n1, n1, n19, n19, n19, n1, n1, n1, n1, + -- z=7, y=2 + n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1, + -- z=7, y=3 + n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1, + -- z=7, y=4 + n1, n1, n1, n1, n6, n13, n6, n1, n1, n1, n1, + -- z=7, y=5 + n1, n2, n4, n4, n6, n6, n6, n4, n4, n2, n1, + -- z=7, y=6 + n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1, + -- z=7, y=7 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=7, y=8 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + + -- z=8, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=8, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=8, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=8, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=8, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=8, y=5 + n1, n2, n2, n4, n4, n4, n4, n4, n2, n2, n1, + -- z=8, y=6 + n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=8, y=7 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + -- z=8, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=9, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=9, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=9, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=9, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=9, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=9, y=5 + n1, n1, n2, n2, n2, n4, n2, n2, n2, n1, n1, + -- z=9, y=6 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + -- z=9, y=7 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=9, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=10, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=5 + n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1, + -- z=10, y=6 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=7 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, +} +} diff --git a/df_trees/schematics/goblin_cap_bigger.lua b/df_trees/schematics/goblin_cap_bigger.lua new file mode 100644 index 0000000..70b7cb0 --- /dev/null +++ b/df_trees/schematics/goblin_cap_bigger.lua @@ -0,0 +1,284 @@ +local n1 = { name = "air", prob=0 } +local n3 = { name = "df_trees:goblin_cap" } +local n4 = { name = "df_trees:goblin_cap_gills" } +local n5 = { name = "df_trees:goblin_cap_stem" } + +return { + yslice_prob = {}, + size = {y = 10, x = 13, z = 13}, + center_pos = {x=6, y=2, z=6}, + data = { + -- z=0, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=5 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=6 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + -- z=0, y=7 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=9 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=1, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=5 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=6 + n1, n1, n1, n3, n3, n3, n4, n3, n3, n3, n1, n1, n1, + -- z=1, y=7 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + -- z=1, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=9 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=2, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=5 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=6 + n1, n1, n3, n4, n4, n4, n4, n4, n4, n4, n3, n1, n1, + -- z=2, y=7 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=2, y=8 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + -- z=2, y=9 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=3, y=0 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=3, y=1 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=3, y=2 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=3, y=3 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=3, y=4 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=3, y=5 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=3, y=6 + n1, n3, n4, n4, n4, n4, n5, n4, n4, n4, n4, n3, n1, + -- z=3, y=7 + n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, + -- z=3, y=8 + n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, + -- z=3, y=9 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + + -- z=4, y=0 + n1, n1, n1, n1, n5, n5, n5, n5, n5, n1, n1, n1, n1, + -- z=4, y=1 + n1, n1, n1, n1, n5, n5, n5, n5, n5, n1, n1, n1, n1, + -- z=4, y=2 + n1, n1, n1, n1, n5, n5, n5, n5, n5, n1, n1, n1, n1, + -- z=4, y=3 + n1, n1, n1, n1, n5, n5, n5, n5, n5, n1, n1, n1, n1, + -- z=4, y=4 + n1, n1, n1, n1, n5, n5, n5, n5, n5, n1, n1, n1, n1, + -- z=4, y=5 + n1, n1, n1, n1, n5, n5, n5, n5, n5, n1, n1, n1, n1, + -- z=4, y=6 + n1, n3, n4, n4, n4, n5, n5, n5, n4, n4, n4, n3, n1, + -- z=4, y=7 + n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, + -- z=4, y=8 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=4, y=9 + n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, + + -- z=5, y=0 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=5, y=1 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=5, y=2 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=5, y=3 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=5, y=4 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=5, y=5 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=5, y=6 + n1, n3, n4, n4, n5, n5, n5, n5, n5, n4, n4, n3, n1, + -- z=5, y=7 + n1, n1, n3, n3, n3, n5, n5, n5, n3, n3, n3, n1, n1, + -- z=5, y=8 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=5, y=9 + n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, + + -- z=6, y=0 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=6, y=1 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=6, y=2 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=6, y=3 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=6, y=4 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=6, y=5 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=6, y=6 + n3, n4, n4, n5, n5, n5, n5, n5, n5, n5, n4, n4, n3, + -- z=6, y=7 + n1, n3, n3, n3, n3, n5, n5, n5, n3, n3, n3, n3, n1, + -- z=6, y=8 + n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, + -- z=6, y=9 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + + -- z=7, y=0 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=7, y=1 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=7, y=2 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=7, y=3 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=7, y=4 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=7, y=5 + n1, n1, n1, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, + -- z=7, y=6 + n1, n3, n4, n4, n5, n5, n5, n5, n5, n4, n4, n3, n1, + -- z=7, y=7 + n1, n1, n3, n3, n3, n5, n5, n5, n3, n3, n3, n1, n1, + -- z=7, y=8 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=7, y=9 + n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, + + -- z=8, y=0 + n1, n1, n1, n1, n5, n5, n5, n5, n5, n1, n1, n1, n1, + -- z=8, y=1 + n1, n1, n1, n1, n5, n5, n5, n5, n5, n1, n1, n1, n1, + -- z=8, y=2 + n1, n1, n1, n1, n5, n5, n5, n5, n5, n1, n1, n1, n1, + -- z=8, y=3 + n1, n1, n1, n1, n5, n5, n5, n5, n5, n1, n1, n1, n1, + -- z=8, y=4 + n1, n1, n1, n1, n5, n5, n5, n5, n5, n1, n1, n1, n1, + -- z=8, y=5 + n1, n1, n1, n1, n5, n5, n5, n5, n5, n1, n1, n1, n1, + -- z=8, y=6 + n1, n3, n4, n4, n4, n5, n5, n5, n4, n4, n4, n3, n1, + -- z=8, y=7 + n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, + -- z=8, y=8 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=8, y=9 + n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, + + -- z=9, y=0 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=9, y=1 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=9, y=2 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=9, y=3 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=9, y=4 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=9, y=5 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=9, y=6 + n1, n3, n4, n4, n4, n4, n5, n4, n4, n4, n4, n3, n1, + -- z=9, y=7 + n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, + -- z=9, y=8 + n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, + -- z=9, y=9 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + + -- z=10, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=5 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=6 + n1, n1, n3, n4, n4, n4, n4, n4, n4, n3, n3, n1, n1, + -- z=10, y=7 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=10, y=8 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + -- z=10, y=9 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=11, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=5 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=6 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=11, y=7 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + -- z=11, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=9 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=12, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=5 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=6 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + -- z=12, y=7 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=9 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, +} +} diff --git a/df_trees/schematics/goblin_cap_bigger_hut.lua b/df_trees/schematics/goblin_cap_bigger_hut.lua new file mode 100644 index 0000000..9be6270 --- /dev/null +++ b/df_trees/schematics/goblin_cap_bigger_hut.lua @@ -0,0 +1,320 @@ +local n1 = { name = "air" } -- external air +local n2 = { name = "df_trees:goblin_cap_stem"} -- below ground, don't force place these +local n3 = { name = "df_trees:goblin_cap" } +local n4 = { name = "df_trees:goblin_cap_gills" } +local n5 = { name = "df_trees:goblin_cap_stem", force_place = true } -- walls, force place these +local n6 = { name = "df_trees:goblin_cap_stem", prob = 198, force_place=true } -- possible window holes +local n7 = { name = "df_trees:goblin_cap_stem_wood", force_place=true } -- internal floor +local n8 = { name = "default:furnace", param2 = 2, force_place=true } +local n9 = { name = "air", force_place=true } -- internal air +local n10 = { name = "default:torch_wall", param2 = 3, force_place = true } +local n12 = {name = "stairs:slab_goblin_cap_stem_wood", param2 = 2} -- porch top +local n13 = { name = "doors:door_wood_a", param2 = 3, force_place = true } +local n14 = { name = "doors:hidden", param2 = 3, force_place = true } +local n15 = n9 -- internal air, but could be a vessel shelf +local n16 = { name = "beds:bed_top", param2 = 3, force_place = true } +local n17 = { name = "beds:bed_bottom", param2 = 3, force_place = true } +local n18 = { name = "default:chest", force_place = true } +local n19 = { name = "default:torch_wall", param2 = 2, force_place = true } +local n20 = {name = "stairs:stair_goblin_cap_stem_wood" } +local n21 = {name = "stairs:stair_goblin_cap_stem_wood", param2 = 2 } +local n22 = {name = "stairs:slab_goblin_cap_stem_wood", param2 = 22} + +if minetest.get_modpath("vessels") then + -- replace torches with glowing bottles, add vessel shelf + n10 = { name = "df_trees:glowing_bottle_red", force_place=true} + n19 = n10 + n15 = { name = "vessels:shelf", param2 = 3, force_place = true } +end + +if not minetest.get_modpath("doors") then + -- replace the door with air + n13 = n9 + n14 = n9 +end +if not minetest.get_modpath("beds") then + --replace the bed with air + n16 = n9 + n17 = n9 +end + + +return { + yslice_prob = {}, + size = {y = 10, x = 13, z = 13}, + center_pos = {x=6, y=2, z=6}, + data = { + -- z=0, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=5 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=6 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + -- z=0, y=7 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=0, y=9 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=1, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=5 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=6 + n1, n1, n1, n3, n3, n3, n4, n3, n3, n3, n1, n1, n1, + -- z=1, y=7 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + -- z=1, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=1, y=9 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=2, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=5 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=2, y=6 + n1, n1, n3, n4, n4, n4, n4, n4, n4, n4, n3, n1, n1, + -- z=2, y=7 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=2, y=8 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + -- z=2, y=9 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=3, y=0 + n1, n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1, n1, + -- z=3, y=1 + n1, n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1, n1, + -- z=3, y=2 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=3, y=3 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=3, y=4 + n1, n1, n1, n1, n1, n5, n6, n5, n1, n1, n1, n1, n1, + -- z=3, y=5 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=3, y=6 + n1, n3, n4, n4, n4, n4, n5, n4, n4, n4, n4, n3, n1, + -- z=3, y=7 + n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, + -- z=3, y=8 + n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, + -- z=3, y=9 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + + -- z=4, y=0 + n1, n1, n1, n1, n2, n2, n2, n2, n2, n12, n22, n1, n1, + -- z=4, y=1 + n1, n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, n1, + -- z=4, y=2 + n1, n1, n1, n1, n5, n7, n7, n7, n5, n1, n1, n1, n1, + -- z=4, y=3 + n1, n1, n1, n1, n5, n8, n9, n9, n5, n1, n1, n1, n1, + -- z=4, y=4 + n1, n1, n1, n1, n5, n10, n9, n9, n5, n1, n1, n1, n1, + -- z=4, y=5 + n1, n1, n1, n1, n5, n5, n9, n5, n5, n1, n1, n1, n1, + -- z=4, y=6 + n1, n3, n4, n4, n4, n5, n5, n5, n4, n4, n4, n3, n1, + -- z=4, y=7 + n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, + -- z=4, y=8 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=4, y=9 + n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, + + -- z=5, y=0 + n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=5, y=1 + n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n20, n1, n1, + -- z=5, y=2 + n1, n1, n1, n5, n7, n7, n7, n7, n7, n5, n1, n1, n1, + -- z=5, y=3 + n1, n1, n1, n5, n9, n9, n9, n9, n9, n5, n1, n1, n1, + -- z=5, y=4 + n1, n1, n1, n5, n9, n9, n9, n9, n9, n5, n1, n1, n1, + -- z=5, y=5 + n1, n1, n1, n5, n5, n9, n9, n9, n5, n5, n1, n1, n1, + -- z=5, y=6 + n1, n3, n4, n4, n5, n9, n9, n9, n5, n4, n4, n3, n1, + -- z=5, y=7 + n1, n1, n3, n3, n3, n5, n5, n5, n3, n3, n3, n1, n1, + -- z=5, y=8 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=5, y=9 + n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, + + -- z=6, y=0 + n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=6, y=1 + n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=6, y=2 + n1, n1, n1, n5, n7, n7, n7, n7, n7, n7, n12, n1, n1, + -- z=6, y=3 + n1, n1, n1, n5, n9, n9, n9, n9, n9, n13, n9, n9, n1, + -- z=6, y=4 + n1, n1, n1, n6, n9, n9, n9, n9, n9, n14, n9, n9, n1, + -- z=6, y=5 + n1, n1, n1, n5, n9, n9, n9, n9, n9, n5, n1, n1, n1, + -- z=6, y=6 + n3, n4, n4, n5, n5, n9, n9, n9, n5, n5, n4, n4, n3, + -- z=6, y=7 + n1, n3, n3, n3, n3, n5, n5, n5, n3, n3, n3, n3, n1, + -- z=6, y=8 + n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, + -- z=6, y=9 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + + -- z=7, y=0 + n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1, n1, + -- z=7, y=1 + n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n21, n1, n1, + -- z=7, y=2 + n1, n1, n1, n5, n7, n7, n7, n7, n7, n5, n1, n1, n1, + -- z=7, y=3 + n1, n1, n1, n5, n15, n9, n9, n9, n9, n5, n1, n1, n1, + -- z=7, y=4 + n1, n1, n1, n5, n9, n9, n9, n9, n9, n5, n1, n1, n1, + -- z=7, y=5 + n1, n1, n1, n5, n5, n9, n9, n9, n5, n5, n1, n1, n1, + -- z=7, y=6 + n1, n3, n4, n4, n5, n9, n9, n9, n5, n4, n4, n3, n1, + -- z=7, y=7 + n1, n1, n3, n3, n3, n5, n5, n5, n3, n3, n3, n1, n1, + -- z=7, y=8 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=7, y=9 + n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, + + -- z=8, y=0 + n1, n1, n1, n1, n2, n2, n2, n2, n2, n12, n22, n1, n1, + -- z=8, y=1 + n1, n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, n1, + -- z=8, y=2 + n1, n1, n1, n1, n5, n7, n7, n7, n5, n1, n1, n1, n1, + -- z=8, y=3 + n1, n1, n1, n1, n5, n16, n17, n18, n5, n1, n1, n1, n1, + -- z=8, y=4 + n1, n1, n1, n1, n5, n9, n9, n19, n5, n1, n1, n1, n1, + -- z=8, y=5 + n1, n1, n1, n1, n5, n5, n9, n5, n5, n1, n1, n1, n1, + -- z=8, y=6 + n1, n3, n4, n4, n4, n5, n5, n5, n4, n4, n4, n3, n1, + -- z=8, y=7 + n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, + -- z=8, y=8 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=8, y=9 + n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, + + -- z=9, y=0 + n1, n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1, n1, + -- z=9, y=1 + n1, n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1, n1, + -- z=9, y=2 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=9, y=3 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=9, y=4 + n1, n1, n1, n1, n1, n5, n6, n5, n1, n1, n1, n1, n1, + -- z=9, y=5 + n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1, + -- z=9, y=6 + n1, n3, n4, n4, n4, n4, n5, n4, n4, n4, n4, n3, n1, + -- z=9, y=7 + n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1, + -- z=9, y=8 + n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1, + -- z=9, y=9 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + + -- z=10, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=5 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=10, y=6 + n1, n1, n3, n4, n4, n4, n4, n4, n4, n3, n3, n1, n1, + -- z=10, y=7 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=10, y=8 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + -- z=10, y=9 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=11, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=5 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=6 + n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1, + -- z=11, y=7 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + -- z=11, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=11, y=9 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + + -- z=12, y=0 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=1 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=2 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=3 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=4 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=5 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=6 + n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1, + -- z=12, y=7 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=8 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + -- z=12, y=9 + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, +} +} diff --git a/df_trees/sounds/dfcaverns_spore_tree_pitter_patter.1.ogg b/df_trees/sounds/dfcaverns_spore_tree_pitter_patter.1.ogg new file mode 100644 index 0000000..6487d03 Binary files /dev/null and b/df_trees/sounds/dfcaverns_spore_tree_pitter_patter.1.ogg differ diff --git a/df_trees/sounds/dfcaverns_spore_tree_pitter_patter.2.ogg b/df_trees/sounds/dfcaverns_spore_tree_pitter_patter.2.ogg new file mode 100644 index 0000000..5b0d682 Binary files /dev/null and b/df_trees/sounds/dfcaverns_spore_tree_pitter_patter.2.ogg differ diff --git a/df_trees/sounds/dfcaverns_spore_tree_pitter_patter.3.ogg b/df_trees/sounds/dfcaverns_spore_tree_pitter_patter.3.ogg new file mode 100644 index 0000000..8bdc900 Binary files /dev/null and b/df_trees/sounds/dfcaverns_spore_tree_pitter_patter.3.ogg differ diff --git a/df_trees/sounds/dfcaverns_spore_tree_pitter_patter.4.ogg b/df_trees/sounds/dfcaverns_spore_tree_pitter_patter.4.ogg new file mode 100644 index 0000000..5574495 Binary files /dev/null and b/df_trees/sounds/dfcaverns_spore_tree_pitter_patter.4.ogg differ diff --git a/df_trees/sounds/license.txt b/df_trees/sounds/license.txt index 4833245..68c4707 100644 --- a/df_trees/sounds/license.txt +++ b/df_trees/sounds/license.txt @@ -1 +1,2 @@ -dfcaverns_fungus_footstep are from https://freesound.org/people/jakeh111/sounds/60853/ under CC-BY-SA 3.0 in 2008 by jakeh111 \ No newline at end of file +dfcaverns_fungus_footstep are from https://freesound.org/people/jakeh111/sounds/60853/ under CC-BY-SA 3.0 in 2008 by jakeh111 +dfcaverns_spore_tree_pitter_patter are from https://freesound.org/people/martinimeniscus/sounds/199332/ by martinimeniscus under the CC0 public domain license \ No newline at end of file diff --git a/df_trees/spindlestem.lua b/df_trees/spindlestem.lua index 046a9c8..a5957bf 100644 --- a/df_trees/spindlestem.lua +++ b/df_trees/spindlestem.lua @@ -46,7 +46,7 @@ local stem_on_place = function(itemstack, placer, pointed_thing) -- add the node and remove 1 item from the itemstack minetest.add_node(pt.above, {name = itemstack:get_name(), param2 = new_param2}) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode", false) then itemstack:take_item() end return itemstack @@ -64,7 +64,7 @@ minetest.register_node("df_trees:spindlestem_stem", { description = S("Spindlestem"), _doc_items_longdesc = df_trees.doc.spindlestem_desc, _doc_items_usagehelp = df_trees.doc.spindlestem_usage, - is_ground_content = true, + is_ground_content = false, groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, spindlestem = 1}, sounds = default.node_sound_wood_defaults(), tiles = { @@ -95,7 +95,7 @@ local register_spindlestem_type = function(item_suffix, colour_name, colour_code minetest.register_node(cap_item, { description = S("@1 Spindlestem Cap", colour_name), - is_ground_content = true, + is_ground_content = false, _doc_items_longdesc = df_trees.doc["spindlestem_cap_"..item_suffix.."_desc"], _doc_items_usagehelp = df_trees.doc["spindlestem_cap_"..item_suffix.."_usage"], groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, spindlestem = 1}, @@ -149,23 +149,34 @@ local register_spindlestem_type = function(item_suffix, colour_name, colour_code on_place = stem_on_place, on_timer = function(pos, elapsed) - local above = vector.add(pos, {x=0,y=1,z=0}) - local node_above = minetest.get_node(above) - local above_def = minetest.registered_nodes[node_above.name] - if not above_def or not above_def.buildable_to then - -- can't grow any more, exit - return - end local meta = minetest.get_meta(pos) local height = meta:get_int("spindlestem_to_grow") + local delay = meta:get_int("spindlestem_delay") + if delay == 0 then + delay = growth_delay() -- compatibility code to ensure no crash for previous version + end local node = minetest.get_node(pos) - minetest.set_node(pos, {name="df_trees:spindlestem_stem", param2 = node.param2}) - minetest.set_node(above, {name=cap_item, param2 = node.param2}) - height = height - 1 + + while height > 0 and elapsed >= delay do + elapsed = elapsed - delay + local this_pos = pos + pos = vector.add(this_pos, {x=0,y=1,z=0}) + local node_above = minetest.get_node(pos) + local above_def = minetest.registered_nodes[node_above.name] + if not above_def or not above_def.buildable_to then + -- can't grow any more, exit + return + end + minetest.set_node(this_pos, {name="df_trees:spindlestem_stem", param2 = node.param2}) + minetest.set_node(pos, {name=cap_item, param2 = node.param2}) + height = height - 1 + end + if height > 0 then - meta = minetest.get_meta(above) + meta = minetest.get_meta(pos) meta:set_int("spindlestem_to_grow", height) - minetest.get_node_timer(above):start(growth_delay()) + meta:set_int("spindlestem_delay", delay) + minetest.get_node_timer(pos):start(delay-elapsed) end end, }) @@ -223,13 +234,6 @@ local register_spindlestem_type = function(item_suffix, colour_name, colour_code end end -local seedling_construct = function(pos) - local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0})) - if minetest.get_item_group(below_node.name, "soil") > 0 then - minetest.get_node_timer(pos):start(growth_delay()) - end -end - minetest.register_node("df_trees:spindlestem_seedling", { description = S("Spindlestem Spawn"), _doc_items_longdesc = df_trees.doc.spindlestem_desc, @@ -241,6 +245,7 @@ minetest.register_node("df_trees:spindlestem_seedling", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", + is_ground_content = false, walkable = false, floodable = true, node_box = { @@ -251,9 +256,21 @@ minetest.register_node("df_trees:spindlestem_seedling", { }, on_place = stem_on_place, - on_construct = seedling_construct, + on_construct = function(pos) + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") == 0 then + return + end + minetest.get_node_timer(pos):start(growth_delay()) + end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() + end, on_timer = function(pos, elapsed) + if df_farming and df_farming.kill_if_sunlit(pos) then + return + end + local cap_item = minetest.get_name_from_content_id(get_spindlestem_cap_type(pos)) local node = minetest.get_node(pos) minetest.set_node(pos, {name=cap_item, param2 = node.param2}) @@ -264,8 +281,10 @@ minetest.register_node("df_trees:spindlestem_seedling", { local height = math.random(1,3) if count > 10 then height = height + 2 end -- if there are a lot of nearby spindlestems, grow taller if height > 0 then + local delay = growth_delay() meta:set_int("spindlestem_to_grow", height) - minetest.get_node_timer(pos):start(growth_delay()) + meta:set_int("spindlestem_delay", delay) + minetest.get_node_timer(pos):start(delay) end end, }) @@ -314,7 +333,7 @@ local c_cyan = minetest.get_content_id("df_trees:spindlestem_cap_cyan") local c_golden = minetest.get_content_id("df_trees:spindlestem_cap_golden") get_spindlestem_cap_type = function(pos) - if pos.y > -100 or minetest.find_node_near(pos, 15, "group:tower_cap") then + if minetest.find_node_near(pos, 15, "group:tower_cap") then return c_white end if minetest.find_node_near(pos, 15, "group:goblin_cap") then @@ -330,7 +349,6 @@ get_spindlestem_cap_type = function(pos) if copper then table.insert(possibilities, c_green) end if iron then table.insert(possibilities, c_red) end if iron and copper then table.insert(possibilities, c_cyan) end - if #possibilities == 0 then return c_white else diff --git a/df_trees/spore_tree.lua b/df_trees/spore_tree.lua index bdc4381..cd0b17b 100644 --- a/df_trees/spore_tree.lua +++ b/df_trees/spore_tree.lua @@ -157,6 +157,7 @@ minetest.register_node("df_trees:spore_tree_sapling", { paramtype = "light", sunlight_propagates = true, walkable = false, + is_ground_content = false, floodable = true, selection_box = { type = "fixed", @@ -167,15 +168,21 @@ minetest.register_node("df_trees:spore_tree_sapling", { sounds = default.node_sound_leaves_defaults(), on_construct = function(pos) - local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0})) - if minetest.get_item_group(below_node.name, "soil") > 0 then - minetest.get_node_timer(pos):start(math.random( - df_trees.config.spore_tree_delay_multiplier*df_trees.config.tree_min_growth_delay, - df_trees.config.spore_tree_delay_multiplier*df_trees.config.tree_max_growth_delay)) + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") == 0 then + return end + minetest.get_node_timer(pos):start(math.random( + df_trees.config.spore_tree_delay_multiplier*df_trees.config.tree_min_growth_delay, + df_trees.config.spore_tree_delay_multiplier*df_trees.config.tree_max_growth_delay)) + end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() end, on_timer = function(pos) + if df_farming and df_farming.kill_if_sunlit(pos) then + return + end minetest.set_node(pos, {name="air"}) df_trees.spawn_spore_tree(pos) end, @@ -187,7 +194,7 @@ local c_spore_pod = minetest.get_content_id("df_trees:spore_tree_fruiting_body") local c_tree = minetest.get_content_id("df_trees:spore_tree") local c_spore_frond = minetest.get_content_id("df_trees:spore_tree_hyphae") -df_trees.spawn_spore_tree_vm = function(vi, area, data, height, size, iters, has_fruiting_bodies) +df_trees.spawn_spore_tree_vm = function(vi, area, data, data_param2, height, size, iters, has_fruiting_bodies) if height == nil then height = math.random(3,6) end if size == nil then size = 2 end if iters == nil then iters = 10 end @@ -204,6 +211,7 @@ df_trees.spawn_spore_tree_vm = function(vi, area, data, height, size, iters, has local node_id = data[vi] if node_id == c_air or node_id == c_ignore or node_id == c_spore_frond or node_id == c_spore_pod then data[vi] = c_tree + data_param2[vi] = 0 end end @@ -218,6 +226,7 @@ df_trees.spawn_spore_tree_vm = function(vi, area, data, height, size, iters, has else data[vi] = c_spore_frond end + data_param2[vi] = 0 end vi = vi + 1 end @@ -240,6 +249,7 @@ df_trees.spawn_spore_tree_vm = function(vi, area, data, height, size, iters, has else data[vi] = c_spore_frond end + data_param2[vi] = 0 end end end @@ -258,10 +268,12 @@ df_trees.spawn_spore_tree = function(pos) ) local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp}) local data = vm:get_data() + local data_param_2 = vm:get_param2_data() - df_trees.spawn_spore_tree_vm(area:indexp(pos), area, data) + df_trees.spawn_spore_tree_vm(area:indexp(pos), area, data, data_param_2) vm:set_data(data) + vm:set_param2_data(data_param_2) vm:write_to_map() vm:update_map() end @@ -284,7 +296,12 @@ minetest.register_abm{ vertical = false, texture = "dfcaverns_spore_tree_spores.png", }) - + if math.random() < 0.025 then + minetest.sound_play("dfcaverns_spore_tree_pitter_patter", { + pos = pos, + gain = 0.2, + }) + end end, } @@ -324,4 +341,3 @@ minetest.register_node("df_trees:spore_tree_ladder", { legacy_wallmounted = true, sounds = default.node_sound_wood_defaults(), }) - diff --git a/df_trees/textures/dfcaverns_vessels_glowing_liquid.png b/df_trees/textures/dfcaverns_vessels_glowing_liquid.png index 0c11d73..ae12065 100644 Binary files a/df_trees/textures/dfcaverns_vessels_glowing_liquid.png and b/df_trees/textures/dfcaverns_vessels_glowing_liquid.png differ diff --git a/df_trees/torchspine.lua b/df_trees/torchspine.lua index 2b13fe8..4ffe86f 100644 --- a/df_trees/torchspine.lua +++ b/df_trees/torchspine.lua @@ -43,7 +43,7 @@ local stal_on_place = function(itemstack, placer, pointed_thing) -- add the node and remove 1 item from the itemstack minetest.add_node(pt.above, {name = itemstack:get_name(), param2 = new_param2}) - if not minetest.setting_getbool("creative_mode") then + if not minetest.settings:get_bool("creative_mode", false) then itemstack:take_item() end return itemstack @@ -63,13 +63,18 @@ minetest.register_node("df_trees:torchspine_1", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - is_ground_content = true, - drops = "default:torch", + is_ground_content = false, + drop = "default:torch", node_box = { type = "fixed", fixed = stal_box_1, }, on_place = stal_on_place, + on_punch = function(pos, node, puncher) + if puncher:get_wielded_item():get_name() == "default:torch" then + minetest.swap_node(pos, {name = "df_trees:torchspine_1_lit", param2 = node.param2}) + end + end, }) minetest.register_node("df_trees:torchspine_1_lit", { @@ -81,9 +86,9 @@ minetest.register_node("df_trees:torchspine_1_lit", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - light_source = 6, - is_ground_content = true, - drops = "default:torch 2", + light_source = 8, + is_ground_content = false, + drop = "default:torch 2", node_box = { type = "fixed", fixed = stal_box_1, @@ -100,7 +105,7 @@ minetest.register_node("df_trees:torchspine_2", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - is_ground_content = true, + is_ground_content = false, node_box = { type = "fixed", fixed = stal_box_2, @@ -126,7 +131,7 @@ minetest.register_node("df_trees:torchspine_3", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - is_ground_content = true, + is_ground_content = false, node_box = { type = "fixed", fixed = stal_box_3, @@ -156,7 +161,7 @@ minetest.register_node("df_trees:torchspine_4", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - is_ground_content = true, + is_ground_content = false, node_box = { type = "fixed", fixed = stal_box_4, @@ -187,6 +192,7 @@ minetest.register_node("df_trees:torchspine_ember", { light_source = 2, paramtype2 = "facedir", walkable = false, + is_ground_content = false, floodable = true, node_box = { type = "fixed", @@ -281,11 +287,11 @@ minetest.register_abm{ minetest.register_abm{ label = "torchspine lighting", nodenames = {"df_trees:torchspine_1"}, - interval = 57, + interval = 30, chance = 10, catch_up = true, action = function(pos) - local above_def = minetest.registered_nodes[minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z})] + local above_def = minetest.registered_nodes[minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name] if above_def and above_def.buildable_to then minetest.swap_node(pos, {name="df_trees:torchspine_1_lit", param2=minetest.get_node(pos).param2}) end @@ -295,7 +301,7 @@ local torchspine_list = {"df_trees:torchspine_1","df_trees:torchspine_2","df_tre minetest.register_abm{ label = "torchspine growing", nodenames = {"df_trees:torchspine_1_lit"}, - interval = 30, + interval = 37, chance = 10, catch_up = true, action = function(pos) @@ -329,4 +335,4 @@ minetest.register_abm{ minetest.swap_node(dest_list[i], {name=torchspine_list[i], param2=param2}) end end, -} \ No newline at end of file +} diff --git a/df_trees/tower_cap.lua b/df_trees/tower_cap.lua index c8a54c2..778eed4 100644 --- a/df_trees/tower_cap.lua +++ b/df_trees/tower_cap.lua @@ -8,7 +8,7 @@ minetest.register_node("df_trees:tower_cap_stem", { _doc_items_longdesc = df_trees.doc.tower_cap_desc, _doc_items_usagehelp = df_trees.doc.tower_cap_usage, tiles = {"dfcaverns_tower_cap.png"}, - is_ground_content = true, + is_ground_content = false, groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, tower_cap = 1}, sounds = df_trees.node_sound_tree_soft_fungus_defaults(), }) @@ -19,7 +19,7 @@ minetest.register_node("df_trees:tower_cap", { _doc_items_longdesc = df_trees.doc.tower_cap_desc, _doc_items_usagehelp = df_trees.doc.tower_cap_usage, tiles = {"dfcaverns_tower_cap.png"}, - is_ground_content = true, + is_ground_content = false, groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, tower_cap = 1}, sounds = df_trees.node_sound_tree_soft_fungus_defaults(), }) @@ -30,7 +30,7 @@ minetest.register_node("df_trees:tower_cap_gills", { _doc_items_longdesc = df_trees.doc.tower_cap_desc, _doc_items_usagehelp = df_trees.doc.tower_cap_usage, tiles = {"dfcaverns_tower_cap_gills.png"}, - is_ground_content = true, + is_ground_content = false, groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, tower_cap = 1}, sounds = default.node_sound_leaves_defaults(), drawtype = "plantlike", @@ -125,6 +125,7 @@ minetest.register_node("df_trees:tower_cap_sapling", { wield_image = "dfcaverns_tower_cap_sapling.png", paramtype = "light", sunlight_propagates = true, + is_ground_content = false, walkable = false, floodable = true, selection_box = { @@ -136,15 +137,21 @@ minetest.register_node("df_trees:tower_cap_sapling", { sounds = default.node_sound_leaves_defaults(), on_construct = function(pos) - local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0})) - if minetest.get_item_group(below_node.name, "soil") > 0 then - minetest.get_node_timer(pos):start(math.random( - df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_min_growth_delay, - df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_max_growth_delay)) + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") == 0 then + return end + minetest.get_node_timer(pos):start(math.random( + df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_min_growth_delay, + df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_max_growth_delay)) + end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() end, on_timer = function(pos) + if df_farming and df_farming.kill_if_sunlit(pos) then + return + end minetest.set_node(pos, {name="air"}) df_trees.spawn_tower_cap(pos) end, diff --git a/df_trees/tunnel_tube.lua b/df_trees/tunnel_tube.lua index 46a859b..37bf7eb 100644 --- a/df_trees/tunnel_tube.lua +++ b/df_trees/tunnel_tube.lua @@ -17,6 +17,7 @@ minetest.register_node("df_trees:tunnel_tube", { tiles = {"dfcaverns_tunnel_tube.png"}, paramtype2 = "facedir", drawtype = "nodebox", + is_ground_content = false, paramtype = "light", groups = {choppy = 3, tree = 1, oddly_breakable_by_hand=1, flammable = 2}, sounds = default.node_sound_wood_defaults(), @@ -40,6 +41,7 @@ minetest.register_node("df_trees:tunnel_tube_slant_bottom", { tiles = {"dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png"}, paramtype2 = "facedir", drawtype = "mesh", + is_ground_content = false, mesh = "tunnel_tube_slant.obj", paramtype = "light", drop = "df_trees:tunnel_tube", @@ -70,6 +72,7 @@ minetest.register_node("df_trees:tunnel_tube_slant_top", { tiles = {"dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png"}, paramtype2 = "facedir", drawtype = "mesh", + is_ground_content = false, mesh = "tunnel_tube_slant_2.obj", paramtype = "light", drop = "df_trees:tunnel_tube", @@ -99,6 +102,7 @@ minetest.register_node("df_trees:tunnel_tube_slant_full", { tiles = {"dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png"}, paramtype2 = "facedir", drawtype = "mesh", + is_ground_content = false, mesh = "tunnel_tube_slant_full.obj", paramtype = "light", drop = "df_trees:tunnel_tube", @@ -129,6 +133,14 @@ minetest.register_craft({ } }) +-- Paper +minetest.register_craft({ + output = "default:paper 3", + type = "shapeless", + recipe = {'df_trees:tunnel_tube', 'bucket:bucket_water'}, + replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}, +}) + minetest.register_node("df_trees:tunnel_tube_wood", { description = S("Tunnel Tube Plies"), _doc_items_longdesc = df_trees.doc.tunnel_tube_desc, @@ -172,6 +184,7 @@ if df_trees.config.enable_tnt then _doc_items_usagehelp = df_trees.doc.tunnel_tube_usage, tiles = {"dfcaverns_tunnel_tube.png^[multiply:#b09090"}, paramtype2 = "facedir", + is_ground_content = false, groups = {choppy = 3, oddly_breakable_by_hand=1, flammable = 2, tnt = 1,}, sounds = default.node_sound_wood_defaults(), on_place = minetest.rotate_node, @@ -227,6 +240,7 @@ if df_trees.config.enable_tnt then _doc_items_longdesc = df_trees.doc.tunnel_tube_desc, _doc_items_usagehelp = df_trees.doc.tunnel_tube_usage, tiles = {"dfcaverns_tunnel_tube.png^[multiply:#b09090"}, + is_ground_content = false, groups = {not_in_creative_inventory = 1,}, light_source = 5, drop = "", @@ -248,6 +262,7 @@ else _doc_items_usagehelp = df_trees.doc.tunnel_tube_usage, tiles = {"dfcaverns_tunnel_tube.png^[multiply:#b09090"}, paramtype2 = "facedir", + is_ground_content = false, groups = {choppy = 3, oddly_breakable_by_hand=1, flammable = 2}, sounds = default.node_sound_wood_defaults(), on_place = minetest.rotate_node, @@ -285,6 +300,7 @@ minetest.register_node("df_trees:tunnel_tube_sapling", { paramtype = "light", sunlight_propagates = true, walkable = false, + is_ground_content = false, floodable = true, selection_box = { type = "fixed", @@ -295,15 +311,21 @@ minetest.register_node("df_trees:tunnel_tube_sapling", { sounds = default.node_sound_leaves_defaults(), on_construct = function(pos) - local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0})) - if minetest.get_item_group(below_node.name, "soil") > 0 then - minetest.get_node_timer(pos):start(math.random( - df_trees.config.tunnel_tube_delay_multiplier*df_trees.config.tree_min_growth_delay, - df_trees.config.tunnel_tube_delay_multiplier*df_trees.config.tree_max_growth_delay)) + if minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") == 0 then + return end + minetest.get_node_timer(pos):start(math.random( + df_trees.config.tunnel_tube_delay_multiplier*df_trees.config.tree_min_growth_delay, + df_trees.config.tunnel_tube_delay_multiplier*df_trees.config.tree_max_growth_delay)) + end, + on_destruct = function(pos) + minetest.get_node_timer(pos):stop() end, on_timer = function(pos) + if df_farming and df_farming.kill_if_sunlit(pos) then + return + end minetest.set_node(pos, {name="air"}) df_trees.spawn_tunnel_tube(pos) end, @@ -385,6 +407,10 @@ df_trees.spawn_tunnel_tube_vm = function(vi, area, data, param2_data, height, di local previous_vi = vi local pattern = tunnel_tube_patterns[height] + if pattern == nil then + minetest.log("error", "Tunnel tube pattern was nil somehow. height: " .. string(height) .. " location: " .. minetest.pos_to_string(area:position(vi))) + return nil + end for i, nodepattern in ipairs(pattern) do local current_vi = vi + nodepattern[1] * increment if data[current_vi] == c_air or data[current_vi] == c_ignore then diff --git a/df_underworld_items/config.lua b/df_underworld_items/config.lua index 84c9fd0..c291630 100644 --- a/df_underworld_items/config.lua +++ b/df_underworld_items/config.lua @@ -7,11 +7,11 @@ local print_settingtypes = false local function setting(stype, name, default, description) local value if stype == "bool" then - value = minetest.setting_getbool(CONFIG_FILE_PREFIX..name) + value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name, default) elseif stype == "string" then - value = minetest.setting_get(CONFIG_FILE_PREFIX..name) + value = minetest.settings:get(CONFIG_FILE_PREFIX..name) elseif stype == "int" or stype == "float" then - value = tonumber(minetest.setting_get(CONFIG_FILE_PREFIX..name)) + value = tonumber(minetest.setting:get(CONFIG_FILE_PREFIX..name)) end if value == nil then value = default diff --git a/df_underworld_items/crystals_amethyst.lua b/df_underworld_items/crystals_amethyst.lua index 091ba23..183a941 100644 --- a/df_underworld_items/crystals_amethyst.lua +++ b/df_underworld_items/crystals_amethyst.lua @@ -7,7 +7,7 @@ minetest.register_node("df_underworld_items:glow_amethyst", { _doc_items_longdesc = df_underworld_items.doc.glow_amethyst_desc, _doc_items_usagehelp = df_underworld_items.doc.glow_amethyst_usage, tiles = {"dfcaverns_glow_amethyst.png"}, - is_ground_content = true, + is_ground_content = false, groups = {cracky=3, pit_plasma_resistant=1}, sounds = default.node_sound_glass_defaults(), light_source = 6, diff --git a/df_underworld_items/depends.txt b/df_underworld_items/depends.txt deleted file mode 100644 index 0ff3e7d..0000000 --- a/df_underworld_items/depends.txt +++ /dev/null @@ -1,7 +0,0 @@ -default -intllib? -doc? -radiant_damage? -mesecons_mvps? -tnt? -stairs \ No newline at end of file diff --git a/df_underworld_items/description.txt b/df_underworld_items/description.txt deleted file mode 100644 index c2ed1a3..0000000 --- a/df_underworld_items/description.txt +++ /dev/null @@ -1 +0,0 @@ -Various node types used by the dfcaverns mapgen mod for its underworld layer. \ No newline at end of file diff --git a/df_underworld_items/glow_stone.lua b/df_underworld_items/glow_stone.lua index c155b10..f5fc882 100644 --- a/df_underworld_items/glow_stone.lua +++ b/df_underworld_items/glow_stone.lua @@ -7,8 +7,19 @@ local glowstone_def = { _doc_items_usagehelp = df_underworld_items.doc.glowstone_usage, light_source = minetest.LIGHT_MAX, description = S("Lightseam"), - tiles = {"dfcaverns_glowstone.png"}, - is_ground_content = true, + tiles = { + { + name = "dfcaverns_glowstone_anim.png", + backface_culling = true, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 8, + }, + }, + }, + is_ground_content = false, groups = {cracky=3}, sounds = default.node_sound_glass_defaults(), paramtype = "light", diff --git a/df_underworld_items/glowing_pit_plasma.lua b/df_underworld_items/glowing_pit_plasma.lua index 3fe263c..2dda754 100644 --- a/df_underworld_items/glowing_pit_plasma.lua +++ b/df_underworld_items/glowing_pit_plasma.lua @@ -35,7 +35,7 @@ minetest.register_node("df_underworld_items:pit_plasma", { liquid_alternative_flowing = "df_underworld_items:pit_plasma_flowing", liquid_alternative_source = "df_underworld_items:pit_plasma", liquid_renewable = false, - is_ground_content = true, + is_ground_content = false, light_source = minetest.LIGHT_MAX, paramtype = "light", }) @@ -84,7 +84,7 @@ minetest.register_node("df_underworld_items:pit_plasma_flowing", { liquid_alternative_flowing = "df_underworld_items:pit_plasma_flowing", liquid_alternative_source = "df_underworld_items:pit_plasma", liquid_renewable = false, - is_ground_content = true, + is_ground_content = false, light_source = minetest.LIGHT_MAX, paramtype = "light", }) @@ -101,7 +101,7 @@ end local sparkle = function(sparkle_pos) minetest.add_particlespawner({ amount = 10, - time = 1, + time = 2, minpos = {x=sparkle_pos.x-5, y=sparkle_pos.y-0.5, z=sparkle_pos.z-5}, maxpos = {x=sparkle_pos.x+5, y=sparkle_pos.y+0.5, z=sparkle_pos.z+5}, minvel = {x=-0.1, y=2, z=-0.1}, @@ -129,7 +129,7 @@ if df_underworld_items.config.destructive_pit_plasma then minetest.register_abm({ label = "glowing pit matter degradation", nodenames = {"group:pit_plasma"}, - interval = 1, + interval = 2, chance = 30, catch_up = false, action = function(pos) @@ -164,7 +164,7 @@ else label = "glowing pit sparkle", nodenames = {"group:pit_plasma"}, neighbors = {"air"}, - interval = 1, + interval = 2, chance = 30, catch_up = false, action = function(pos) diff --git a/df_underworld_items/init.lua b/df_underworld_items/init.lua index fe6020e..8c20071 100644 --- a/df_underworld_items/init.lua +++ b/df_underworld_items/init.lua @@ -9,3 +9,5 @@ dofile(modpath.."/crystals_amethyst.lua") dofile(modpath.."/glow_stone.lua") dofile(modpath.."/slade.lua") dofile(modpath.."/glowing_pit_plasma.lua") + +dofile(modpath.."/puzzle_seal.lua") \ No newline at end of file diff --git a/df_underworld_items/locale/it.po b/df_underworld_items/locale/it.po index 0b41157..87de49e 100644 --- a/df_underworld_items/locale/it.po +++ b/df_underworld_items/locale/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: dfcaverns module's Italian locale\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-12-24 21:26-0700\n" +"POT-Creation-Date: 2020-01-26 21:11-0700\n" "PO-Revision-Date: 2017-08-17 23:01+0100\n" "Last-Translator: H4mlet \n" "Language-Team: ITALIANO\n" @@ -85,6 +85,38 @@ msgstr "" msgid "Lightseam" msgstr "" +#: df_underworld_items\puzzle_seal.lua:108 +msgid "Turn" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:178 +msgid "Slade Puzzle Seal" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:238 +msgid "Active Slade Breacher" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:340 +msgid "Breach in the Slade" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:351 +msgid "Inscribed Slade Block" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:374 +msgid "Slade Capstone" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:443 +msgid "Slade Block Stair" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:444 +msgid "Slade Block Slab" +msgstr "" + #: df_underworld_items\slade.lua:18 msgid "Slade" msgstr "" @@ -97,23 +129,23 @@ msgstr "" msgid "Slade Wall" msgstr "" -#: df_underworld_items\slade.lua:77 +#: df_underworld_items\slade.lua:78 msgid "Slade Sand" msgstr "" -#: df_underworld_items\slade.lua:89 +#: df_underworld_items\slade.lua:90 msgid "Slade Block" msgstr "" -#: df_underworld_items\slade.lua:105 +#: df_underworld_items\slade.lua:106 msgid "Slade Seal" msgstr "" -#: df_underworld_items\slade.lua:154 +#: df_underworld_items\slade.lua:155 msgid "Slade Stair" msgstr "" -#: df_underworld_items\slade.lua:155 +#: df_underworld_items\slade.lua:156 msgid "Slade Slab" msgstr "" diff --git a/df_underworld_items/locale/template.pot b/df_underworld_items/locale/template.pot index e374492..b4ec046 100644 --- a/df_underworld_items/locale/template.pot +++ b/df_underworld_items/locale/template.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-12-24 21:26-0700\n" +"POT-Creation-Date: 2020-01-26 21:11-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -84,6 +84,38 @@ msgstr "" msgid "Lightseam" msgstr "" +#: df_underworld_items\puzzle_seal.lua:108 +msgid "Turn" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:178 +msgid "Slade Puzzle Seal" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:238 +msgid "Active Slade Breacher" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:340 +msgid "Breach in the Slade" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:351 +msgid "Inscribed Slade Block" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:374 +msgid "Slade Capstone" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:443 +msgid "Slade Block Stair" +msgstr "" + +#: df_underworld_items\puzzle_seal.lua:444 +msgid "Slade Block Slab" +msgstr "" + #: df_underworld_items\slade.lua:18 msgid "Slade" msgstr "" @@ -96,22 +128,22 @@ msgstr "" msgid "Slade Wall" msgstr "" -#: df_underworld_items\slade.lua:77 +#: df_underworld_items\slade.lua:78 msgid "Slade Sand" msgstr "" -#: df_underworld_items\slade.lua:89 +#: df_underworld_items\slade.lua:90 msgid "Slade Block" msgstr "" -#: df_underworld_items\slade.lua:105 +#: df_underworld_items\slade.lua:106 msgid "Slade Seal" msgstr "" -#: df_underworld_items\slade.lua:154 +#: df_underworld_items\slade.lua:155 msgid "Slade Stair" msgstr "" -#: df_underworld_items\slade.lua:155 +#: df_underworld_items\slade.lua:156 msgid "Slade Slab" msgstr "" diff --git a/df_underworld_items/mod.conf b/df_underworld_items/mod.conf index 1a841d5..e73f207 100644 --- a/df_underworld_items/mod.conf +++ b/df_underworld_items/mod.conf @@ -1,4 +1,4 @@ name = df_underworld_items description = Various node types used by the dfcaverns mapgen mod for its underworld layer. -depends = default, stairs -optional_depends = intllib, doc, radiant_damage, mesecons_mvps, tnt +depends = default +optional_depends = intllib, doc, radiant_damage, mesecons_mvps, tnt, stairs diff --git a/df_underworld_items/models/underworld_capstone.obj b/df_underworld_items/models/underworld_capstone.obj new file mode 100644 index 0000000..fd987cc --- /dev/null +++ b/df_underworld_items/models/underworld_capstone.obj @@ -0,0 +1,34 @@ +# Blender v2.81 (sub 16) OBJ File: 'capstone.blend' +# www.blender.org +mtllib underworld_capstone.mtl +o Cube +v 0.000000 0.500000 0.000000 +v 0.500000 -0.500000 -0.500000 +v 0.500000 -0.500000 0.500000 +v -0.500000 -0.500000 -0.500000 +v -0.500000 -0.500000 0.500000 +vt 1.000000 1.000000 +vt 0.000000 0.000000 +vt 0.000000 1.000000 +vt 1.000000 0.000000 +vt 0.500000 1.000000 +vt 1.000000 0.000000 +vt 1.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vn 0.0000 -1.0000 0.0000 +vn 0.0000 0.4472 0.8944 +vn -0.8944 0.4472 0.0000 +vn 0.8944 0.4472 0.0000 +vn 0.0000 0.4472 -0.8944 +g Cube_Cube_Material +usemtl Material +s off +f 2/1/1 5/2/1 4/3/1 +f 2/1/1 3/4/1 5/2/1 +g Cube_Cube_side +usemtl side +f 3/4/2 1/5/2 5/2/2 +f 5/2/3 1/5/3 4/6/3 +f 2/7/4 1/5/4 3/8/4 +f 4/9/5 1/5/5 2/7/5 diff --git a/df_underworld_items/models/underworld_seal.obj b/df_underworld_items/models/underworld_seal.obj new file mode 100644 index 0000000..1abb6da --- /dev/null +++ b/df_underworld_items/models/underworld_seal.obj @@ -0,0 +1,386 @@ +# Blender v2.81 (sub 16) OBJ File: 'seal.blend' +# www.blender.org +mtllib underworld_seal.mtl +o Cylinder +v -0.292175 -0.501653 -0.705374 +v -0.292175 0.501653 -0.705374 +v 0.292175 -0.501653 -0.705374 +v 0.292175 0.501653 -0.705374 +v 0.705374 -0.501653 -0.292175 +v 0.705374 0.501653 -0.292175 +v 0.705374 -0.501653 0.292175 +v 0.705374 0.501653 0.292175 +v 0.292175 -0.501653 0.705374 +v 0.292175 0.501653 0.705374 +v -0.292175 -0.501653 0.705374 +v -0.292175 0.501653 0.705374 +v -0.705374 -0.501653 0.292175 +v -0.705374 0.501653 0.292175 +v -0.705374 -0.501653 -0.292175 +v -0.705374 0.501653 -0.292175 +v -0.146088 -0.752480 -0.352687 +v 0.146088 -0.752480 -0.352687 +v 0.146088 0.752480 -0.352687 +v -0.146088 0.752480 -0.352687 +v 0.352687 -0.752480 -0.146088 +v 0.352687 0.752480 -0.146088 +v 0.352687 -0.752480 0.146088 +v 0.352687 0.752480 0.146088 +v 0.146088 -0.752480 0.352687 +v 0.146088 0.752480 0.352687 +v -0.146088 -0.752480 0.352687 +v -0.146088 0.752480 0.352687 +v -0.352687 -0.752480 0.146088 +v -0.352687 0.752480 0.146088 +v -0.352687 -0.752480 -0.146088 +v -0.352687 0.752480 -0.146088 +v -0.000000 0.501653 -0.705374 +v 0.498774 0.501653 -0.498774 +v 0.705374 0.501653 0.000000 +v 0.498774 0.501653 0.498774 +v -0.000000 0.501653 0.705374 +v -0.498775 0.501653 0.498775 +v -0.705374 0.501653 0.000000 +v -0.498775 0.501653 -0.498774 +v -0.093326 0.852022 -0.690234 +v -0.000000 -0.501653 -0.705374 +v 0.498774 -0.501653 -0.498774 +v 0.705374 -0.501653 0.000000 +v 0.498774 -0.501653 0.498774 +v -0.000000 -0.501653 0.705374 +v -0.498775 -0.501653 0.498775 +v -0.705374 -0.501653 0.000000 +v -0.498775 -0.501653 -0.498774 +v -0.000000 -0.501653 -0.705374 +v 0.292175 -0.501653 -0.705374 +v 0.292175 -0.501653 -0.705374 +v -0.000000 0.501653 -0.705374 +v -0.292175 0.501653 -0.705374 +v -0.292175 0.501653 -0.705374 +v -0.292175 -0.501653 -0.705374 +v -0.292175 -0.501653 -0.705374 +v 0.292175 0.501653 -0.705374 +v 0.292175 0.501653 -0.705374 +v 0.498774 -0.501653 -0.498774 +v 0.705374 -0.501653 -0.292175 +v 0.705374 -0.501653 -0.292175 +v 0.498774 0.501653 -0.498774 +v 0.705374 0.501653 -0.292175 +v 0.705374 0.501653 -0.292175 +v 0.705374 -0.501653 0.000000 +v 0.705374 -0.501653 0.292175 +v 0.705374 -0.501653 0.292175 +v 0.705374 0.501653 0.000000 +v 0.705374 0.501653 0.292175 +v 0.705374 0.501653 0.292175 +v 0.498774 -0.501653 0.498774 +v 0.292175 -0.501653 0.705374 +v 0.292175 -0.501653 0.705374 +v 0.498774 0.501653 0.498774 +v 0.292175 0.501653 0.705374 +v 0.292175 0.501653 0.705374 +v -0.000000 -0.501653 0.705374 +v -0.292175 -0.501653 0.705374 +v -0.292175 -0.501653 0.705374 +v -0.000000 0.501653 0.705374 +v -0.292175 0.501653 0.705374 +v -0.292175 0.501653 0.705374 +v -0.498775 -0.501653 0.498775 +v -0.705374 -0.501653 0.292175 +v -0.705374 -0.501653 0.292175 +v -0.498775 0.501653 0.498775 +v -0.705374 0.501653 0.292175 +v -0.705374 0.501653 0.292175 +v -0.705374 -0.501653 0.000000 +v -0.705374 -0.501653 -0.292175 +v -0.705374 -0.501653 -0.292175 +v -0.705374 0.501653 0.000000 +v -0.705374 0.501653 -0.292175 +v -0.705374 0.501653 -0.292175 +v -0.498775 -0.501653 -0.498774 +v -0.498775 0.501653 -0.498774 +v -0.146088 -0.752480 -0.352687 +v 0.146088 -0.752480 -0.352687 +v 0.146088 0.752480 -0.352687 +v -0.146088 0.752480 -0.352687 +v 0.352687 -0.752480 -0.146088 +v 0.352687 0.752480 -0.146088 +v 0.352687 -0.752480 0.146088 +v 0.352687 0.752480 0.146088 +v 0.146088 -0.752480 0.352687 +v 0.146088 0.752480 0.352687 +v -0.146088 -0.752480 0.352687 +v -0.146088 0.752480 0.352687 +v -0.352687 -0.752480 0.146088 +v -0.352687 0.752480 0.146088 +v -0.352687 -0.752480 -0.146088 +v -0.352687 0.752480 -0.146088 +vt 0.500000 1.000000 +vt 0.250000 0.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt 0.750000 0.000000 +vt 1.000000 0.000000 +vt 0.250000 1.000000 +vt 0.250000 0.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt 0.750000 0.000000 +vt 1.000000 0.000000 +vt 0.500000 1.000000 +vt 0.250000 0.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt 0.750000 0.000000 +vt 1.000000 0.000000 +vt 0.500000 1.000000 +vt 0.250000 0.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt 0.750000 0.000000 +vt 1.000000 0.000000 +vt 0.750000 0.000000 +vt 0.750000 1.000000 +vt 0.250000 1.000000 +vt 1.250000 0.000000 +vt 1.250000 1.000000 +vt 0.750000 1.000000 +vt 0.750000 0.000000 +vt 0.500000 1.000000 +vt 0.750000 1.000000 +vt 1.250000 0.000000 +vt 1.250000 1.000000 +vt 0.750000 1.000000 +vt 0.750000 0.000000 +vt 0.750000 1.000000 +vt 0.250000 1.000000 +vt 1.250000 0.000000 +vt 1.250000 1.000000 +vt 0.750000 1.000000 +vt 0.750000 0.000000 +vt 0.750000 1.000000 +vt 0.250000 1.000000 +vt 1.250000 0.000000 +vt 1.250000 1.000000 +vt 0.750000 1.000000 +vt 0.000000 0.292893 +vt 0.707106 0.000000 +vt 1.000000 0.707107 +vt 1.000000 0.292893 +vt 0.292893 0.000000 +vt 0.000000 0.707106 +vt 0.707107 1.000000 +vt 0.292893 1.000000 +vt 0.000000 0.707106 +vt 0.292893 0.000000 +vt 1.000000 0.292893 +vt 0.292893 1.000000 +vt 0.707107 1.000000 +vt 1.000000 0.707107 +vt 0.707106 0.000000 +vt 0.000000 0.292893 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.500000 0.000000 +vt 1.000000 1.000000 +vt -0.000000 1.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vt 0.000000 -0.000000 +vt 1.000000 0.000000 +vn 0.0000 0.0000 -1.0000 +vn 0.7071 0.0000 -0.7071 +vn 1.0000 0.0000 0.0000 +vn 0.7071 0.0000 0.7071 +vn 0.0000 0.0000 1.0000 +vn -0.7071 0.0000 0.7071 +vn -1.0000 0.0000 0.0000 +vn -0.7071 0.0000 -0.7071 +vn 0.0000 1.0000 0.0000 +vn 0.0000 -1.0000 0.0000 +vn 0.4098 -0.8149 -0.4098 +vn 0.4098 0.8149 0.4098 +vn -0.5796 -0.8149 0.0000 +vn 0.4098 0.8149 -0.4098 +vn -0.5796 0.8149 0.0000 +vn 0.0000 -0.8149 0.5796 +vn 0.0000 0.8149 0.5796 +vn 0.5796 -0.8149 0.0000 +vn -0.4098 -0.8149 -0.4098 +vn 0.0000 -0.8149 -0.5796 +vn 0.5796 0.8149 0.0000 +vn -0.4098 0.8149 -0.4098 +vn 0.0000 0.8149 -0.5796 +vn -0.4098 -0.8149 0.4098 +vn -0.4098 0.8149 0.4098 +vn 0.4098 -0.8149 0.4098 +g Cylinder_Cylinder_Sides +usemtl Sides +s off +f 53/1/1 51/2/1 50/3/1 +f 63/4/2 61/5/2 60/6/2 +f 70/7/3 67/8/3 66/9/3 +f 75/10/4 73/11/4 72/12/4 +f 81/13/5 79/14/5 78/15/5 +f 87/16/6 85/17/6 84/18/6 +f 93/19/7 91/20/7 90/21/7 +f 97/22/8 57/23/8 96/24/8 +f 50/3/1 56/25/1 54/26/1 +f 53/1/1 58/27/1 51/2/1 +f 50/3/1 54/26/1 53/1/1 +f 60/6/2 3/28/2 59/29/2 +f 63/4/2 64/30/2 61/5/2 +f 60/6/2 59/29/2 63/4/2 +f 66/9/3 5/31/3 69/32/3 +f 5/31/3 65/33/3 69/32/3 +f 69/32/3 70/7/3 66/9/3 +f 72/12/4 7/34/4 71/35/4 +f 75/10/4 76/36/4 73/11/4 +f 72/12/4 71/35/4 75/10/4 +f 78/15/5 9/37/5 77/38/5 +f 81/13/5 82/39/5 79/14/5 +f 78/15/5 77/38/5 81/13/5 +f 84/18/6 11/40/6 83/41/6 +f 87/16/6 88/42/6 85/17/6 +f 84/18/6 83/41/6 87/16/6 +f 90/21/7 13/43/7 89/44/7 +f 93/19/7 94/45/7 91/20/7 +f 90/21/7 89/44/7 93/19/7 +f 96/24/8 15/46/8 95/47/8 +f 97/22/8 2/48/8 57/23/8 +f 96/24/8 95/47/8 97/22/8 +g Cylinder_Cylinder_Caps +usemtl Caps +f 111/49/9 26/50/9 103/51/9 +f 104/52/10 108/53/10 112/54/10 +f 103/51/9 100/55/9 111/49/9 +f 100/55/9 101/56/9 111/49/9 +f 101/56/9 113/57/9 111/49/9 +f 111/49/9 109/58/9 26/50/9 +f 26/50/9 105/59/9 103/51/9 +f 112/54/10 98/60/10 99/61/10 +f 99/61/10 21/62/10 104/52/10 +f 104/52/10 106/63/10 108/53/10 +f 108/53/10 110/64/10 112/54/10 +f 112/54/10 99/61/10 104/52/10 +g Cylinder_Cylinder_Edges +usemtl Edges +f 43/65/11 102/66/11 18/67/11 +f 36/68/12 24/69/12 107/70/12 +f 48/71/13 31/72/13 29/73/13 +f 34/74/14 19/75/14 22/76/14 +f 39/77/15 30/78/15 32/79/15 +f 46/80/16 27/81/16 25/82/16 +f 37/83/17 107/84/17 28/85/17 +f 44/86/18 23/87/18 102/88/18 +f 49/89/19 17/90/19 31/91/19 +f 42/92/20 18/93/20 17/94/20 +f 35/95/21 22/96/21 24/97/21 +f 40/98/22 32/99/22 20/100/22 +f 33/101/23 20/102/23 19/103/23 +f 47/104/24 29/105/24 27/106/24 +f 38/107/25 28/108/25 30/109/25 +f 45/110/26 25/111/26 23/112/26 +f 107/70/12 10/113/12 36/68/12 +f 36/68/12 8/114/12 24/69/12 +f 22/76/14 6/115/14 34/74/14 +f 34/74/14 4/116/14 19/75/14 +f 32/79/15 16/117/15 39/77/15 +f 39/77/15 14/118/15 30/78/15 +f 28/85/17 12/119/17 37/83/17 +f 37/83/17 10/120/17 107/84/17 +f 24/97/21 8/121/21 35/95/21 +f 35/95/21 6/122/21 22/96/21 +f 20/100/22 55/123/22 40/98/22 +f 40/98/22 16/124/22 32/99/22 +f 19/103/23 4/125/23 33/101/23 +f 33/101/23 55/126/23 20/102/23 +f 30/109/25 14/127/25 38/107/25 +f 38/107/25 12/128/25 28/108/25 +f 18/67/11 52/129/11 43/65/11 +f 43/65/11 62/130/11 102/66/11 +f 29/73/13 86/131/13 48/71/13 +f 48/71/13 92/132/13 31/72/13 +f 25/82/16 74/133/16 46/80/16 +f 46/80/16 80/134/16 27/81/16 +f 102/88/18 62/135/18 44/86/18 +f 44/86/18 68/136/18 23/87/18 +f 31/91/19 92/137/19 49/89/19 +f 49/89/19 1/138/19 17/90/19 +f 17/94/20 1/139/20 42/92/20 +f 42/92/20 52/140/20 18/93/20 +f 27/106/24 80/141/24 47/104/24 +f 47/104/24 86/142/24 29/105/24 +f 23/112/26 68/143/26 45/110/26 +f 45/110/26 74/144/26 25/111/26 diff --git a/df_underworld_items/puzzle_seal.lua b/df_underworld_items/puzzle_seal.lua new file mode 100644 index 0000000..35bcfc2 --- /dev/null +++ b/df_underworld_items/puzzle_seal.lua @@ -0,0 +1,506 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + +local named_waypoints_path = minetest.get_modpath("named_waypoints") + +local invulnerable = df_underworld_items.config.invulnerable_slade and not minetest.settings:get_bool("creative_mode") + +local can_dig +if invulnerable then + can_dig = function(pos, player) + return minetest.check_player_privs(player, "server") + end +end + +local slade_groups = {stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1, cracky = 3, not_in_creative_inventory=1} +if invulnerable then + slade_groups.immortal = 1 +end + + +-- Ensures that the node is functioning correctly +local ensure_meta = function(pos) + local meta = minetest.get_meta(pos) + if not meta:contains("key") then + local inv = meta:get_inventory() + inv:set_size("main", 8) + local next_seed = math.random() * 2^21 + math.randomseed(pos.x + pos.z^16) + -- Key is consistent with location + local key = {math.random(0,7), math.random(0,7), math.random(0,7), math.random(0,7), math.random(0,7), math.random(0,7),math.random(0,7), math.random(0,7)} + math.randomseed(next_seed) + meta:set_string("key", minetest.serialize(key)) + meta:mark_as_private("key") + end + + local timer = minetest.get_node_timer(pos) + if not timer:is_started() then + timer:start(4) + end +end + +local colour_groups = { + "color_black", -- 0 + "color_red", -- 1 + "color_orange", -- 2 + "color_yellow", -- 3 + "color_green", -- 4 + "color_blue", -- 5 + "color_violet", -- 6 + "color_white"} -- 7 + +local test_key = function(pos) + local meta = minetest.get_meta(pos) + if not meta:contains("key") then + return false + end + + local keystring = meta:get_string("key") + local key = minetest.deserialize(keystring) + local inv = meta:get_inventory() + + for offset = 0, 7 do + local valid + for i = 0, 7 do + valid = true + local keyval = (i + offset) % 8 + 1 + local key_group = colour_groups[key[keyval]+1] + local item = inv:get_stack("main", i+1) + if minetest.get_item_group(item:get_name(), key_group) == 0 then + valid = false + break + end + end + if valid then + local unlocked = meta:get_int("unlocked") + if unlocked == 0 then + meta:set_int("unlocked", 1) + end + return true + end + end + meta:set_int("unlocked", 0) + return false +end + + +--We were a powerful culture. +--This place is not a place of honor. +--No esteemed deed is commemorated here. +--What is here is dangerous and repulsive. +--This message is a warning about danger. +--The danger is still present. +--The danger is unleashed if you disturb this place. +--This place is best shunned and left uninhabited. + +local formspec_prefix = "df_underworld_items_puzzle_seal:" +local get_formspec = function(pos, unlocked) + local formspec = + "size[8,8]" + .."image[0,0;2.5,4;dfcaverns_puzzle_inscription_background.png^dfcaverns_puzzle_inscription_1.png]" + .."image[5.8,0;2.5,4;dfcaverns_puzzle_inscription_background.png^[transformR180^dfcaverns_puzzle_inscription_2.png]" + .."container[2.25,0]" + .."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0.25,0.25;1,1;0]" + .."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;1.25,0;1,1;1]" + .."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;2.25,0.25;1,1;2]" + .."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;2.5,1.25;1,1;3]" + .."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;2.25,2.25;1,1;4]" + .."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;1.25,2.5;1,1;5]" + .."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0.25,2.25;1,1;6]" + .."list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,1.25;1,1;7]" + if unlocked then + formspec = formspec .. "image_button[1.25,1.25;1,1;dfcaverns_seal.png;open;"..S("Turn").."]" + else + formspec = formspec .. "image[1.25,1.25;1,1;dfcaverns_seal.png]" + end + + formspec = formspec + .."container_end[]" +-- .."container[5,0.5]" +-- .."box[0,0;1,5;#0A0000]box[0.1,0.1;0.8,4.8;#000000]box[0.1," .. 0.1 + 4.8*completion ..";0.8,".. 4.8*completion ..";#FFCC22]" +-- .."container_end[]" + .."container[0,4]list[current_player;main;0,0;8,1;]listring[]" + .."list[current_player;main;0,1.25;8,3;8]container_end[]" + return formspec +end +local refresh_formspec = function(pos, player) + local player_name = player:get_player_name() + local unlocked = test_key(pos) + local formspec = get_formspec(pos, unlocked) + minetest.show_formspec(player_name, formspec_prefix..minetest.pos_to_string(pos), formspec) +end + +local show_key = function(pos, index) + minetest.sound_play("dfcaverns_seal_key", { + pos = pos, + gain = 0.125, + max_hear_distance = 32, + }) + local meta = minetest.get_meta(pos) + local keystring = meta:get_string("key") + local key = minetest.deserialize(keystring) + --minetest.chat_send_all(keystring) + local minpos = vector.add(pos, {x=-1, y=1, z=-1}) + local maxpos = vector.add(pos, {x=1, y=3, z=1}) + minetest.add_particlespawner({ + amount = key[index+1], + time = 0.5, + minpos = minpos, + maxpos = maxpos, + minvel = {x=-0.25, y=0, z=-0.25}, + maxvel = {x=0.25, y=0.25, z=0.25}, + minacc = {x=0, y=0, z=0}, + maxacc = {x=0, y=0, z=0}, + minexptime = 3, + maxexptime = 3, + minsize = 1, + maxsize = 1, + texture = "dfcaverns_puzzle_particle.png", + glow = 8, + }) +end + +local show_unlocked = function(pos, global) + -- Plays globally. This is deliberate. + if global then + minetest.sound_play("dfcaverns_seal_unlocked", {}) + else + minetest.sound_play("dfcaverns_seal_unlocked", {pos = pos, max_hear_distance = 128,}) + end + minetest.add_particle({ + pos = pos, + velocity = {x=0, y=1, z=0}, + expirationtime = 30, + size = 20, + texture = "dfcaverns_seal.png^[invert:rgb^[brighten", + glow = 15, +-- vertical = true, + }) +end + +local puzzle_seal_def = { + description = S("Slade Puzzle Seal"), + _doc_items_longdesc = nil, + _doc_items_usagehelp = nil, + drawtype = "mesh", + mesh = "underworld_seal.obj", + tiles = {"dfcaverns_slade_block.png", "dfcaverns_slade_block.png^dfcaverns_seal.png", "dfcaverns_slade_block.png^(dfcaverns_inscription_1.png^[opacity:128)"}, + paramtype = "light", + paramtype2 = "facedir", + light_source = 8, + groups = slade_groups, + sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }), + selection_box = { + type = "fixed", + fixed = {-0.625, -0.625, -0.625, 0.625, 0.625, 0.625}, + }, + collision_box = { + type = "fixed", + fixed = {-0.625, -0.625, -0.625, 0.625, 0.625, 0.625}, + }, + is_ground_content = false, + can_dig = can_dig, + on_blast = function() end, + on_rotate = function() return false end, + on_construct = function(pos) + ensure_meta(pos) + end, + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + ensure_meta(pos) + refresh_formspec(pos, clicker) + end, + on_timer = function(pos, elapsed) + local meta = minetest.get_meta(pos) + local unlocked = meta:get_int("unlocked") + if unlocked > 0 then + meta:set_int("unlocked", unlocked + 1) + show_unlocked(pos, unlocked <= 13) + else + local index = meta:get_int("key_index") + show_key(pos, index) + meta:set_int("key_index", (index+1) % 8) + end + minetest.get_node_timer(pos):start(4) + end, + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + refresh_formspec(pos, player) + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + refresh_formspec(pos, player) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + refresh_formspec(pos, player) + end, +} + + +minetest.register_node("df_underworld_items:puzzle_seal", puzzle_seal_def) + +-------------------------------------------------------------------------------- +-- Once the seal is opened, it turns into this and digs its way down through the slade. + +local digging_seal_def = { + description = S("Active Slade Breacher"), + _doc_items_longdesc = nil, + _doc_items_usagehelp = nil, + drawtype = "mesh", + mesh = "underworld_seal.obj", + tiles = {"dfcaverns_pit_plasma_static.png", "dfcaverns_pit_plasma_static.png^dfcaverns_seal.png", "dfcaverns_pit_plasma_static.png"}, + paramtype = "light", + paramtype2 = "facedir", + light_source = default.LIGHT_MAX, + groups = {immortal=1, stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1, not_in_creative_inventory=1}, + sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }), + selection_box = { + type = "fixed", + fixed = {-0.625, -0.625, -0.625, 0.625, 0.625, 0.625}, + }, + collision_box = { + type = "fixed", + fixed = {-0.625, -0.625, -0.625, 0.625, 0.625, 0.625}, + }, + is_ground_content = false, + can_dig = can_dig, + on_blast = function() end, + on_rotate = function() return false end, + on_construct = function(pos) + minetest.get_node_timer(pos):start(0) + end, + on_timer = function(pos, elapsed) + local node = minetest.get_node(pos) + local below_node = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) + if below_node.name == "ignore" then + -- map's not loaded below, try again later + minetest.get_node_timer(pos):start(4) + return + end + + minetest.sound_play("dfcaverns_massive_digging", { + pos = pos, + gain = 1.0, + max_hear_distance = 32, + }) + + local minpos = vector.add(pos, {x=0, y=-1, z=0}) + minetest.add_particlespawner({ + amount = 100, + time = 4, + minpos = minpos, + maxpos = minpos, + minvel = {x=-5, y=0, z=-5}, + maxvel = {x=5, y=20, z=5}, + minacc = {x=0, y=-10, z=0}, + maxacc = {x=0, y=-10, z=0}, + minexptime = 5, + maxexptime = 15, + minsize = 1, + maxsize = 5, + texture = "dfcaverns_glowpit_particle.png", + collisiondetection = true, + collision_removal = true, + glow = 15, + }) + + if minetest.get_item_group(below_node.name, "slade") == 0 then + tnt.boom({x=pos.x, y=pos.y-2, z=pos.z}, {radius=3}) + minetest.set_node(pos, {name="default:lava_source"}) + return + end + + local rot = node.param2 + if rot == 0 then + minetest.place_schematic({x=pos.x-3, y=pos.y-2, z=pos.z-3}, df_underworld_items.seal_stair_schem, 0, {}, true) + node.param2 = 1 + elseif rot == 1 then + minetest.place_schematic({x=pos.x-3, y=pos.y-2, z=pos.z-3}, df_underworld_items.seal_stair_schem, 90, {}, true) + node.param2 = 2 + elseif rot == 2 then + minetest.place_schematic({x=pos.x-3, y=pos.y-2, z=pos.z-3}, df_underworld_items.seal_stair_schem, 180, {}, true) + node.param2 = 3 + elseif rot == 3 then + minetest.place_schematic({x=pos.x-3, y=pos.y-2, z=pos.z-3}, df_underworld_items.seal_stair_schem, 270, {}, true) + node.param2 = 0 + else + tnt.boom(pos, {radius=3}) + minetest.set_node(pos, {name="default:lava_source"}) + return + end + minetest.set_node(pos, {name="air"}) + local newpos = {x=pos.x, y=pos.y-2, z=pos.z} + minetest.set_node(newpos, node) + minetest.get_node_timer(newpos):start(4) + end, +} + +minetest.register_node("df_underworld_items:digging_seal", digging_seal_def) + +local prefix_len = string.len(formspec_prefix) +minetest.register_on_player_receive_fields(function(player, formname, fields) + if formname:sub(1,prefix_len) ~= formspec_prefix or not fields.open then + return + end + local pos_string = formname:sub(prefix_len+1) + local pos = minetest.string_to_pos(pos_string) + if test_key(pos) then + if named_waypoints_path then + named_waypoints.update_waypoint("puzzle_seals", pos, {name=S("Breach in the Slade"), color=0xFA264F, player=player:get_player_name()}) + end + minetest.log("action", "[df_underworld_items] " .. player:get_player_name() .. " triggered a puzzle seal at " .. pos_string) + minetest.set_node(pos, {name="df_underworld_items:digging_seal", param2 = math.random(1,4)-1}) + minetest.get_node_timer(pos):start(4) + minetest.close_formspec(player:get_player_name(), formname) + end +end) + +------------------------------------------------------------------------------------------------- + +local inscription_block_def = { + description = S("Inscribed Slade Block"), + _doc_items_longdesc = nil, + _doc_items_usagehelp = nil, + tiles = { + "dfcaverns_slade_block.png", + "dfcaverns_slade_block.png", + "dfcaverns_slade_block.png^(dfcaverns_inscription_1.png^[opacity:128)", + "dfcaverns_slade_block.png^(dfcaverns_inscription_2.png^[opacity:128)", + "dfcaverns_slade_block.png^(dfcaverns_inscription_3.png^[opacity:128)", + "dfcaverns_slade_block.png^(dfcaverns_inscription_4.png^[opacity:128)", + }, + paramtype2 = "facedir", + groups = slade_groups, + sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }), + is_ground_content = false, + can_dig = can_dig, + on_blast = function() end, + on_rotate = function() return false end, +} + +minetest.register_node("df_underworld_items:inscription_block", inscription_block_def) + + +local capstone_def = { + description = S("Slade Capstone"), + _doc_items_longdesc = nil, + _doc_items_usagehelp = nil, + drawtype = "mesh", + mesh = "underworld_capstone.obj", + tiles = { + "dfcaverns_slade_block.png", + "dfcaverns_slade_block.png" + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.25, 0, -0.25, 0.25, 0.5, 0.25}, + }, + }, + collision_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.25, 0, -0.25, 0.25, 0.5, 0.25}, + }, + }, + paramtype = "light", + paramtype2 = "facedir", + groups = slade_groups, + light_source = 8, + sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }), + is_ground_content = false, + can_dig = can_dig, + on_blast = function() end, + on_rotate = function() return false end, +} + +minetest.register_node("df_underworld_items:slade_capstone", capstone_def) + +----------------------------------------------------------------------------------------- +-- Schematics + +local n1 = { name = "df_underworld_items:slade_block" } +local n5 = { name = "default:meselamp" } +local n6 = { name = "air", prob = 0 } -- ceiling pieces to leave in place +local n8 = { name = "df_underworld_items:puzzle_seal" } +local n3 = { name = "air"} +local n2 = n3 +local n4 = n3 +local n7 = n3 +local n9 = n3 +local n10 = n1 +local n11 = n3 + +local n12 = { name = "df_underworld_items:inscription_block", param2 = 0 } +local n13 = { name = "df_underworld_items:inscription_block", param2 = 1 } +local n14 = { name = "df_underworld_items:inscription_block", param2 = 2 } +local n15 = { name = "df_underworld_items:inscription_block", param2 = 3 } +local n16 = { name = "df_underworld_items:slade_capstone"} + +if minetest.get_modpath("stairs") then + local stair_groups = {level = 3, mese_radiation_shield=1, pit_plasma_resistant=1, slade=1, cracky = 3} + if invulnerable then + stair_groups.immortal = 1 + end + + stairs.register_stair_and_slab( + "slade_block", + "df_underworld_items:slade_block", + stair_groups, + {"dfcaverns_slade_block.png"}, + S("Slade Block Stair"), + S("Slade Block Slab"), + default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }) + ) + + if invulnerable then + for name, def in pairs(minetest.registered_nodes) do + if name:sub(1,7) == "stairs:" and name:sub(-11) == "slade_block" then + minetest.override_item(name, {can_dig = can_dig}) + end + end + end + + n2 = { name = "stairs:stair_slade_block", param2 = 3 } + n4 = { name = "stairs:stair_slade_block", param2 = 1 } + n7 = { name = "stairs:stair_slade_block", param2 = 2 } + n9 = { name = "stairs:stair_slade_block" } + n10 = { name = "stairs:slab_slade_block", param2 = 21 } + n11 = { name = "stairs:slab_slade_block", param2 = 1 } +end + +df_underworld_items.seal_temple_schem = { + size = {y = 6, x = 7, z = 7}, + data = { + n15, n2, n3, n3, n3, n4, n14, n14, n3, n3, n3, n3, n3, n15, n13, n3, n3, + n3, n3, n3, n13, n16, n3, n3, n3, n3, n3, n16, n6, n6, n6, n6, n6, n6, + n6, n6, n6, n6, n6, n6, n6, n6, n7, n3, n3, n3, n3, n3, n7, n3, n3, + n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, + n3, n3, n6, n3, n3, n3, n3, n3, n6, n6, n6, n6, n6, n6, n6, n6, n3, + n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, + n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n6, n3, n3, n3, n3, n3, n6, + n6, n6, n3, n3, n3, n6, n6, n3, n3, n3, n8, n3, n3, n3, n3, n3, n3, + n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, + n3, n6, n3, n3, n3, n3, n3, n6, n6, n6, n3, n3, n3, n6, n6, n3, n3, + n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, + n3, n3, n3, n3, n3, n3, n3, n3, n3, n6, n3, n3, n3, n3, n3, n6, n6, + n6, n3, n3, n3, n6, n6, n9, n3, n3, n3, n3, n3, n9, n3, n3, n3, n3, + n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, n3, + n6, n3, n3, n3, n3, n3, n6, n6, n6, n6, n6, n6, n6, n6, n12, n2, n3, + n3, n3, n4, n12, n14, n3, n3, n3, n3, n3, n15, n13, n3, n3, n3, n3, n3, + n12, n16, n3, n3, n3, n3, n3, n16, n6, n6, n6, n6, n6, n6, n6, n6, n6, + n6, n6, n6, n6, n6, + } +} + +df_underworld_items.seal_stair_schem = { + size = {y = 2, x = 7, z = 7}, + data = { + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n10, + n3, n3, n3, n1, n1, n3, n11, n1, n10, n3, n1, n1, n11, n3, n3, n3, n3, + n1, n1, n3, n3, n3, n3, n3, n1, n1, n3, n3, n3, n3, n3, n1, n1, n3, + n3, n3, n3, n3, n1, n1, n3, n3, n3, n3, n3, n1, n1, n3, n3, n3, n3, + n3, n1, n1, n3, n3, n3, n3, n3, n1, n1, n3, n3, n3, n3, n3, n1, n1, + n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, + } +} \ No newline at end of file diff --git a/df_underworld_items/slade.lua b/df_underworld_items/slade.lua index 4d4490d..1f79df6 100644 --- a/df_underworld_items/slade.lua +++ b/df_underworld_items/slade.lua @@ -4,13 +4,13 @@ local S, NS = dofile(MP.."/intllib.lua") local invulnerable = df_underworld_items.config.invulnerable_slade and not minetest.settings:get_bool("creative_mode") +local server_diggable_only = function(pos, player) + return minetest.check_player_privs(player, "server") +end + local add_immortality = function(slade_def) slade_def.groups.immortal = 1 - slade_def.groups.cracky = nil - --slade_def.on_destruct = function() end - --slade_def.can_dig = function(pos, player) return minetest.settings:get_bool("creative_mode") == true end - --slade_def.diggable = false - --slade_def.on_blast = function() end + slade_def.can_dig = server_diggable_only return slade_def end @@ -64,6 +64,7 @@ local slade_wall_def = { paramtype = "light", tiles = {"dfcaverns_slade_brick.png"}, walkable = true, + is_ground_content = false, groups = { cracky=3, stone=1, level=3, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1}, sounds = default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }), } @@ -78,7 +79,7 @@ minetest.register_node("df_underworld_items:slade_sand", { _doc_items_longdesc = df_underworld_items.doc.slade_desc, _doc_items_usagehelp = df_underworld_items.doc.slade_usage, tiles = {"dfcaverns_slade_sand.png"}, - is_ground_content = true, + is_ground_content = false, groups = {crumbly = 3, level = 2, falling_node = 1, slade=1, pit_plasma_resistant=1, mese_radiation_shield=1}, sounds = default.node_sound_gravel_defaults({ footstep = {name = "default_gravel_footstep", gain = 0.45}, @@ -142,10 +143,9 @@ if minetest.get_modpath("stairs") then local stair_groups = {level = 3, mese_radiation_shield=1, pit_plasma_resistant=1, slade=1} if invulnerable then stair_groups.immortal = 1 - else - stair_groups.cracky = 3 end - + stair_groups.cracky = 3 + stairs.register_stair_and_slab( "slade_brick", "df_underworld_items:slade_brick", @@ -155,6 +155,15 @@ if minetest.get_modpath("stairs") then S("Slade Slab"), default.node_sound_stone_defaults({ footstep = { name = "bedrock2_step", gain = 1 } }) ) + + if invulnerable then + for name, def in pairs(minetest.registered_nodes) do + if name:sub(1,7) == "stairs:" and name:sub(-11) == "slade_brick" then + minetest.override_item(name, {can_dig = server_diggable_only}) + end + end + end + end if minetest.get_modpath("mesecons_mvps") and df_underworld_items.config.invulnerable_slade then diff --git a/df_underworld_items/sounds/dfcaverns_massive_digging.1.ogg b/df_underworld_items/sounds/dfcaverns_massive_digging.1.ogg new file mode 100644 index 0000000..0f73c50 Binary files /dev/null and b/df_underworld_items/sounds/dfcaverns_massive_digging.1.ogg differ diff --git a/df_underworld_items/sounds/dfcaverns_massive_digging.2.ogg b/df_underworld_items/sounds/dfcaverns_massive_digging.2.ogg new file mode 100644 index 0000000..7352741 Binary files /dev/null and b/df_underworld_items/sounds/dfcaverns_massive_digging.2.ogg differ diff --git a/df_underworld_items/sounds/dfcaverns_massive_digging.3.ogg b/df_underworld_items/sounds/dfcaverns_massive_digging.3.ogg new file mode 100644 index 0000000..ec7ebe9 Binary files /dev/null and b/df_underworld_items/sounds/dfcaverns_massive_digging.3.ogg differ diff --git a/df_underworld_items/sounds/dfcaverns_seal_key.ogg b/df_underworld_items/sounds/dfcaverns_seal_key.ogg new file mode 100644 index 0000000..f56c5c5 Binary files /dev/null and b/df_underworld_items/sounds/dfcaverns_seal_key.ogg differ diff --git a/df_underworld_items/sounds/dfcaverns_seal_unlocked.ogg b/df_underworld_items/sounds/dfcaverns_seal_unlocked.ogg new file mode 100644 index 0000000..34b82a5 Binary files /dev/null and b/df_underworld_items/sounds/dfcaverns_seal_unlocked.ogg differ diff --git a/df_underworld_items/sounds/license.txt b/df_underworld_items/sounds/license.txt index 195505b..8027b80 100644 --- a/df_underworld_items/sounds/license.txt +++ b/df_underworld_items/sounds/license.txt @@ -9,4 +9,10 @@ dfcaverns_grinding_stone.3.ogg - from https://freesound.org/people/FreqMan/sound dfcaverns_arcing.1.ogg - from https://freesound.org/people/unfa/sounds/264827/ by unfa under Creative Commons BY 3.0 dfcaverns_arcing.2.ogg - from https://freesound.org/people/unfa/sounds/264827/ by unfa under Creative Commons BY 3.0 dfcaverns_arcing.3.ogg - from https://freesound.org/people/unfa/sounds/264827/ by unfa under Creative Commons BY 3.0 -dfcaverns_arcing.4.ogg - from https://freesound.org/people/unfa/sounds/264827/ by unfa under Creative Commons BY 3.0 \ No newline at end of file +dfcaverns_arcing.4.ogg - from https://freesound.org/people/unfa/sounds/264827/ by unfa under Creative Commons BY 3.0 + +dfcaverns_seal_unlocked.ogg - from https://freesound.org/people/juskiddink/sounds/74920/ by juskiddink under Creative Commons BY 3.0 +dfcaverns_seal_key.ogg - From https://freesound.org/people/megashroom/sounds/391488/ by megashroom under the CC0 public domain license +dfcaverns_massive_digging.1.ogg - from https://freesound.org/people/OGsoundFX/sounds/423120/ by OGsoundFX under Creative Commons BY 3.0 +dfcaverns_massive_digging.2.ogg - from https://freesound.org/people/OGsoundFX/sounds/423120/ by OGsoundFX under Creative Commons BY 3.0 +dfcaverns_massive_digging.3.ogg - from https://freesound.org/people/OGsoundFX/sounds/423120/ by OGsoundFX under Creative Commons BY 3.0 \ No newline at end of file diff --git a/df_underworld_items/textures/dfcaverns_glowstone.png b/df_underworld_items/textures/dfcaverns_glowstone.png deleted file mode 100644 index c944289..0000000 Binary files a/df_underworld_items/textures/dfcaverns_glowstone.png and /dev/null differ diff --git a/df_underworld_items/textures/dfcaverns_glowstone_anim.png b/df_underworld_items/textures/dfcaverns_glowstone_anim.png new file mode 100644 index 0000000..cee2e21 Binary files /dev/null and b/df_underworld_items/textures/dfcaverns_glowstone_anim.png differ diff --git a/df_underworld_items/textures/dfcaverns_inscription_1.png b/df_underworld_items/textures/dfcaverns_inscription_1.png new file mode 100644 index 0000000..d538be1 Binary files /dev/null and b/df_underworld_items/textures/dfcaverns_inscription_1.png differ diff --git a/df_underworld_items/textures/dfcaverns_inscription_2.png b/df_underworld_items/textures/dfcaverns_inscription_2.png new file mode 100644 index 0000000..2f2fc54 Binary files /dev/null and b/df_underworld_items/textures/dfcaverns_inscription_2.png differ diff --git a/df_underworld_items/textures/dfcaverns_inscription_3.png b/df_underworld_items/textures/dfcaverns_inscription_3.png new file mode 100644 index 0000000..2565917 Binary files /dev/null and b/df_underworld_items/textures/dfcaverns_inscription_3.png differ diff --git a/df_underworld_items/textures/dfcaverns_inscription_4.png b/df_underworld_items/textures/dfcaverns_inscription_4.png new file mode 100644 index 0000000..600fe7d Binary files /dev/null and b/df_underworld_items/textures/dfcaverns_inscription_4.png differ diff --git a/df_underworld_items/textures/dfcaverns_puzzle_inscription_1.png b/df_underworld_items/textures/dfcaverns_puzzle_inscription_1.png new file mode 100644 index 0000000..cf07a56 Binary files /dev/null and b/df_underworld_items/textures/dfcaverns_puzzle_inscription_1.png differ diff --git a/df_underworld_items/textures/dfcaverns_puzzle_inscription_2.png b/df_underworld_items/textures/dfcaverns_puzzle_inscription_2.png new file mode 100644 index 0000000..5bcec13 Binary files /dev/null and b/df_underworld_items/textures/dfcaverns_puzzle_inscription_2.png differ diff --git a/df_underworld_items/textures/dfcaverns_puzzle_inscription_background.png b/df_underworld_items/textures/dfcaverns_puzzle_inscription_background.png new file mode 100644 index 0000000..876b340 Binary files /dev/null and b/df_underworld_items/textures/dfcaverns_puzzle_inscription_background.png differ diff --git a/df_underworld_items/textures/dfcaverns_puzzle_particle.png b/df_underworld_items/textures/dfcaverns_puzzle_particle.png new file mode 100644 index 0000000..8fcb641 Binary files /dev/null and b/df_underworld_items/textures/dfcaverns_puzzle_particle.png differ diff --git a/df_underworld_items/textures/dfcaverns_slade.png b/df_underworld_items/textures/dfcaverns_slade.png index 97ed8c1..c8c942f 100644 Binary files a/df_underworld_items/textures/dfcaverns_slade.png and b/df_underworld_items/textures/dfcaverns_slade.png differ diff --git a/df_underworld_items/textures/dfcaverns_slade_block.png b/df_underworld_items/textures/dfcaverns_slade_block.png index 7b263f8..310044f 100644 Binary files a/df_underworld_items/textures/dfcaverns_slade_block.png and b/df_underworld_items/textures/dfcaverns_slade_block.png differ diff --git a/df_underworld_items/textures/dfcaverns_slade_brick.png b/df_underworld_items/textures/dfcaverns_slade_brick.png index de104cd..9a2e91e 100644 Binary files a/df_underworld_items/textures/dfcaverns_slade_brick.png and b/df_underworld_items/textures/dfcaverns_slade_brick.png differ diff --git a/df_underworld_items/textures/dfcaverns_slade_sand.png b/df_underworld_items/textures/dfcaverns_slade_sand.png index 5acbfb8..f740d3a 100644 Binary files a/df_underworld_items/textures/dfcaverns_slade_sand.png and b/df_underworld_items/textures/dfcaverns_slade_sand.png differ diff --git a/df_underworld_items/textures/license.txt b/df_underworld_items/textures/license.txt index 54f29db..23fe5f1 100644 --- a/df_underworld_items/textures/license.txt +++ b/df_underworld_items/textures/license.txt @@ -2,4 +2,6 @@ All textures not specifically listed here are created by FaceDeer and released u dfcaverns_glow_amethyst, dfcaverns_glow_amethist_ore - from caverealms glow_amethyst -dfcaverns_slade, dfcaverns_slade_sand, dfcaverns_slade_brick, dfcaverns_glowstone, are all from the Nether mod by PilzAdam: Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) http://creativecommons.org/licenses/by-sa/3.0/ \ No newline at end of file +dfcaverns_slade, dfcaverns_slade_sand, dfcaverns_slade_brick, are all from the Nether mod by PilzAdam: Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) http://creativecommons.org/licenses/by-sa/3.0/ + +dfcaverns_glowstone_anim is derived from an animated gif of the Sun's surface released by the National Science Foundation under the public domain \ No newline at end of file diff --git a/df_underworld_items/textures/puzzle inscriptions.xcf b/df_underworld_items/textures/puzzle inscriptions.xcf new file mode 100644 index 0000000..1821a83 Binary files /dev/null and b/df_underworld_items/textures/puzzle inscriptions.xcf differ diff --git a/guide.md b/guide.md index f499edd..16affc0 100644 --- a/guide.md +++ b/guide.md @@ -208,4 +208,16 @@ Just as ominously, the ancient bones of long-dead warriors are scattered amidst ![Glowing pit](./df_caverns/screenshots/glowing_pit.jpg) -Also scattered around the Underworld are the occasional twisting shaft leading down into the Slade. The edges of these shafts are encrusted with glowing purple crystals and the bottoms of these shafts are filled with some form of shimmering liquid that destroys whatever tries to penetrate it. \ No newline at end of file +Also scattered around the Underworld are the occasional twisting shaft leading down into the Slade. The edges of these shafts are encrusted with glowing purple crystals and the bottoms of these shafts are filled with some form of shimmering liquid that destroys whatever tries to penetrate it. + +There may be other ways to get through the Slade, but the ancient warriors fought hard to seal them... + +![Mysterious seal](./df_caverns/screenshots/mysterious_seal.jpg) + +# Primordial Deeps + +What mysteries lie below? Perhaps a realm that time itself has forgotten, with life from a world that no longer exists? + +And why was it locked away? + +![Primordial Fungal](./df_caverns/screenshots/primordial_fungal.jpg) ![Primordial Jungle](./df_caverns/screenshots/primordial_jungle.jpg) diff --git a/ice_sprites/depends.txt b/ice_sprites/depends.txt deleted file mode 100644 index e642580..0000000 --- a/ice_sprites/depends.txt +++ /dev/null @@ -1,4 +0,0 @@ -fireflies? -vessels? -doc? -intllib? \ No newline at end of file diff --git a/ice_sprites/init.lua b/ice_sprites/init.lua index 01339d3..c94c6d2 100644 --- a/ice_sprites/init.lua +++ b/ice_sprites/init.lua @@ -38,6 +38,7 @@ minetest.register_node("ice_sprites:ice_sprite", { paramtype = "light", sunlight_propagates = true, buildable_to = true, + is_ground_content = false, walkable = false, groups = {catchable = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1}, selection_box = { @@ -75,6 +76,7 @@ minetest.register_node("ice_sprites:hidden_ice_sprite", { paramtype = "light", sunlight_propagates = true, walkable = false, + is_ground_content = false, pointable = false, diggable = false, buildable_to = true, @@ -124,6 +126,7 @@ minetest.register_node("ice_sprites:ice_sprite_bottle", { paramtype = "light", sunlight_propagates = true, light_source = 9, + is_ground_content = false, walkable = false, groups = {dig_immediate = 3, attached_node = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1}, selection_box = { diff --git a/mapgen_helper b/mapgen_helper index 970defb..5fe751e 160000 --- a/mapgen_helper +++ b/mapgen_helper @@ -1 +1 @@ -Subproject commit 970defba65ec69dd78008d1bef4ac82f44f22bab +Subproject commit 5fe751ea81b8a4e85479f4ed3aabede7fb060791 diff --git a/mine_gas/depends.txt b/mine_gas/depends.txt deleted file mode 100644 index 106b7db..0000000 --- a/mine_gas/depends.txt +++ /dev/null @@ -1,3 +0,0 @@ -default -tnt? -doc? \ No newline at end of file diff --git a/mine_gas/init.lua b/mine_gas/init.lua index 4eb38aa..863a0e6 100644 --- a/mine_gas/init.lua +++ b/mine_gas/init.lua @@ -31,6 +31,7 @@ minetest.register_node("mine_gas:gas", { walkable = false, pointable = false, diggable = false, + is_ground_content = false, buildable_to = true, drawtype = "glasslike", drowning = 1, diff --git a/mine_gas/textures/mine_gas_wisp_inventory.png b/mine_gas/textures/mine_gas_wisp_inventory.png index 612dcea..ddf4de1 100644 Binary files a/mine_gas/textures/mine_gas_wisp_inventory.png and b/mine_gas/textures/mine_gas_wisp_inventory.png differ diff --git a/mine_gas/wisp.lua b/mine_gas/wisp.lua index b8e9c86..64db382 100644 --- a/mine_gas/wisp.lua +++ b/mine_gas/wisp.lua @@ -14,6 +14,7 @@ minetest.register_node("mine_gas:gas_wisp", { _doc_items_longdesc = wisp_desc, _doc_items_usagehelp = wisp_usage, walkable = false, + is_ground_content = false, diggable = false, buildable_to = true, drawtype = "plantlike", diff --git a/minetestmapper colors.txt b/minetestmapper colors.txt index 002d3d6..4859505 100644 --- a/minetestmapper colors.txt +++ b/minetestmapper colors.txt @@ -53,9 +53,9 @@ df_mapitems:cave_coral_1 101 73 70 df_mapitems:cave_coral_2 101 73 70 df_mapitems:cave_coral_3 101 73 70 df_mapitems:cave_pearls 233 221 212 -df_mapitems:cobble_with_floor_fungus 133 130 111 -df_mapitems:cobble_with_floor_fungus_fine 105 103 86 -df_mapitems:dirt_with_cave_moss 90 176 173 +df_mapitems:cobble_with_floor_fungus 142 139 124 +df_mapitems:cobble_with_floor_fungus_fine 119 116 106 +df_mapitems:dirt_with_cave_moss 86 174 171 df_mapitems:dry_flowstone 97 94 93 df_mapitems:dry_stal_1 97 94 93 df_mapitems:dry_stal_2 97 94 93 @@ -64,24 +64,78 @@ df_mapitems:dry_stal_4 97 94 93 df_mapitems:glow_mese 143 136 2 df_mapitems:glow_ruby_ore 164 74 82 df_mapitems:glow_worm 183 255 255 -df_mapitems:ice_with_hoar_moss 114 132 160 -df_mapitems:icicle_1 171 191 217 -df_mapitems:icicle_2 171 191 217 -df_mapitems:icicle_3 171 191 217 -df_mapitems:icicle_4 171 191 217 +df_mapitems:ice_with_hoar_moss 113 138 172 +df_mapitems:icicle_1 168 206 247 +df_mapitems:icicle_2 168 206 247 +df_mapitems:icicle_3 168 206 247 +df_mapitems:icicle_4 168 206 247 df_mapitems:med_crystal 202 56 52 df_mapitems:med_crystal_30 202 56 52 df_mapitems:med_crystal_30_45 202 56 52 df_mapitems:mese_crystal 143 136 2 df_mapitems:salt_crystal 248 201 201 -df_mapitems:salty_cobble 135 122 116 -df_mapitems:snareweed 94 65 46 +df_mapitems:salty_cobble 147 134 133 +df_mapitems:snareweed 79 55 35 df_mapitems:veinstone 101 74 69 df_mapitems:wet_flowstone 129 127 126 df_mapitems:wet_stal_1 129 127 126 df_mapitems:wet_stal_2 129 127 126 df_mapitems:wet_stal_3 129 127 126 df_mapitems:wet_stal_4 129 127 126 +df_primordial_items:dirt_with_jungle_grass 15 32 8 +df_primordial_items:dirt_with_mycelium 132 127 157 +df_primordial_items:fern_1 6 52 42 +df_primordial_items:fern_2 1 51 24 +df_primordial_items:fern_sapling 8 54 22 +df_primordial_items:fern_wood 131 102 57 +df_primordial_items:fungal_grass_1 118 121 180 +df_primordial_items:fungal_grass_2 116 118 179 +df_primordial_items:giant_fern_leaves 16 52 29 +df_primordial_items:giant_fern_tree 59 107 64 +df_primordial_items:giant_fern_tree_slant_bottom 59 107 64 +df_primordial_items:giant_fern_tree_slant_full 59 107 64 +df_primordial_items:giant_fern_tree_slant_top 59 107 64 +df_primordial_items:giant_hypha 221 206 230 +df_primordial_items:giant_hypha_apical_mapgen 221 206 230 +df_primordial_items:giant_hypha_apical_meristem 221 206 230 +df_primordial_items:giant_hypha_root 221 206 230 +df_primordial_items:glow_orb 176 172 223 +df_primordial_items:glow_orb_hanging 174 173 210 +df_primordial_items:glow_orb_stalks 135 136 196 +df_primordial_items:glow_plant_1 168 101 171 +df_primordial_items:glow_plant_2 50 91 101 +df_primordial_items:glow_plant_3 54 108 134 +df_primordial_items:glow_pods 209 128 186 +df_primordial_items:glownode 174 175 199 +df_primordial_items:glownode_stalk 146 147 198 +df_primordial_items:jungle_grass_1 45 68 32 +df_primordial_items:jungle_grass_2 42 65 30 +df_primordial_items:jungle_grass_3 39 62 29 +df_primordial_items:jungle_ivy 8 53 15 +df_primordial_items:jungle_leaves 1 45 16 +df_primordial_items:jungle_leaves_glowing 0 87 90 +df_primordial_items:jungle_mushroom_1 92 76 67 +df_primordial_items:jungle_mushroom_2 101 85 76 +df_primordial_items:jungle_mushroom_cap_1 176 137 105 +df_primordial_items:jungle_mushroom_cap_2 72 51 34 +df_primordial_items:jungle_mushroom_sapling 101 85 76 +df_primordial_items:jungle_mushroom_trunk 165 140 125 +df_primordial_items:jungle_roots_1 33 25 16 +df_primordial_items:jungle_roots_2 36 18 9 +df_primordial_items:jungle_thorns 28 22 17 +df_primordial_items:jungle_tree 144 107 73 +df_primordial_items:jungle_tree_glowing 144 107 73 +df_primordial_items:jungle_tree_mossy 144 107 73 +df_primordial_items:jungletree_sapling 27 60 80 +df_primordial_items:mush_sapling 128 123 151 +df_primordial_items:mushroom_cap 47 35 66 +df_primordial_items:mushroom_gills 163 167 192 +df_primordial_items:mushroom_gills_glowing 197 180 249 +df_primordial_items:mushroom_trunk 161 171 196 +df_primordial_items:packed_roots 21 11 6 +df_primordial_items:plant_matter 27 45 21 +df_primordial_items:primordial_mush_cap_wood 118 117 140 +df_primordial_items:primordial_mush_trunk_wood 169 171 193 df_trees:black_cap 58 58 58 df_trees:black_cap_gills 0 0 0 df_trees:black_cap_sapling 66 69 76 @@ -96,10 +150,10 @@ df_trees:fungiwood 225 211 117 df_trees:fungiwood_sapling 228 191 86 df_trees:fungiwood_shelf 225 211 117 df_trees:fungiwood_wood 193 173 84 -df_trees:glowing_bottle_cyan 237 237 237 -df_trees:glowing_bottle_golden 237 237 237 -df_trees:glowing_bottle_green 237 237 237 -df_trees:glowing_bottle_red 237 237 237 +df_trees:glowing_bottle_cyan 214 215 223 +df_trees:glowing_bottle_golden 214 215 223 +df_trees:glowing_bottle_green 214 215 223 +df_trees:glowing_bottle_red 214 215 223 df_trees:goblin_cap 197 68 17 df_trees:goblin_cap_gills 239 169 169 df_trees:goblin_cap_sapling 196 175 170 @@ -111,10 +165,10 @@ df_trees:nether_cap_gills 3 120 144 df_trees:nether_cap_sapling 3 88 231 df_trees:nether_cap_stem 58 51 142 df_trees:nether_cap_wood 17 17 95 -df_trees:spindlestem_cap_cyan 235 230 215 -df_trees:spindlestem_cap_golden 235 230 215 -df_trees:spindlestem_cap_green 235 230 215 -df_trees:spindlestem_cap_red 235 230 215 +df_trees:spindlestem_cap_cyan 179 230 215 +df_trees:spindlestem_cap_golden 235 230 164 +df_trees:spindlestem_cap_green 179 230 164 +df_trees:spindlestem_cap_red 235 176 164 df_trees:spindlestem_cap_white 235 230 215 df_trees:spindlestem_seedling 235 230 215 df_trees:spindlestem_stem 235 230 215 @@ -125,7 +179,7 @@ df_trees:spore_tree_ladder 191 186 175 df_trees:spore_tree_sapling 163 152 146 df_trees:spore_tree_wood 210 199 170 df_trees:torchspine_1 11 11 11 -df_trees:torchspine_1_lit 195 170 11 +df_trees:torchspine_1_lit 231 203 35 df_trees:torchspine_2 53 53 53 df_trees:torchspine_3 94 95 95 df_trees:torchspine_4 137 137 137 @@ -143,13 +197,17 @@ df_trees:tunnel_tube_slant_bottom 201 0 140 df_trees:tunnel_tube_slant_full 201 0 140 df_trees:tunnel_tube_slant_top 201 0 140 df_trees:tunnel_tube_wood 157 20 98 +df_underworld_items:digging_seal 231 167 236 df_underworld_items:glow_amethyst 105 42 125 df_underworld_items:glowstone 237 220 185 +df_underworld_items:inscription_block 74 39 39 df_underworld_items:pit_plasma 230 164 235 df_underworld_items:pit_plasma_flowing 231 167 236 +df_underworld_items:puzzle_seal 74 39 39 df_underworld_items:slade 71 38 38 df_underworld_items:slade_block 74 39 39 df_underworld_items:slade_brick 68 40 40 +df_underworld_items:slade_capstone 74 39 39 df_underworld_items:slade_sand 54 36 36 df_underworld_items:slade_seal 68 36 36 df_underworld_items:slade_wall 68 40 40 @@ -157,12 +215,12 @@ dynamic_liquid:clay 183 183 183 dynamic_liquid:spring 68 65 54 ice_sprites:ice_sprite 184 255 255 ice_sprites:ice_sprite_bottle 188 194 206 -magma_conduits:glow_obsidian 108 11 11 -magma_conduits:hot_cobble 121 27 27 -magma_conduits:lava_flowing 255 100 0 -magma_conduits:lava_source 255 100 0 +magma_conduits:glow_obsidian 49 5 5 +magma_conduits:hot_cobble 79 52 49 +magma_conduits:lava_flowing 203 108 20 +magma_conduits:lava_source 210 116 23 magma_conduits:stone 97 94 93 -mine_gas:gas_seep 87 85 84 +mine_gas:gas_seep 89 86 85 mine_gas:gas_wisp 0 138 255 oil:oil_flowing 40 40 40 oil:oil_source 40 40 40 @@ -197,6 +255,7 @@ stairs:slab_fungiwood_wood 193 173 84 stairs:slab_goblin_cap_stem_wood 215 205 165 stairs:slab_goblin_cap_wood 215 68 19 stairs:slab_nether_cap_wood 17 17 95 +stairs:slab_slade_block 74 39 39 stairs:slab_slade_brick 68 40 40 stairs:slab_spore_tree_wood 210 199 170 stairs:slab_tower_cap_wood 236 231 221 @@ -212,6 +271,7 @@ stairs:stair_inner_fungiwood_wood 193 173 84 stairs:stair_inner_goblin_cap_stem_wood 215 205 165 stairs:stair_inner_goblin_cap_wood 215 68 19 stairs:stair_inner_nether_cap_wood 17 17 95 +stairs:stair_inner_slade_block 74 39 39 stairs:stair_inner_slade_brick 68 40 40 stairs:stair_inner_spore_tree_wood 210 199 170 stairs:stair_inner_tower_cap_wood 236 231 221 @@ -223,21 +283,13 @@ stairs:stair_outer_fungiwood_wood 193 173 84 stairs:stair_outer_goblin_cap_stem_wood 215 205 165 stairs:stair_outer_goblin_cap_wood 215 68 19 stairs:stair_outer_nether_cap_wood 17 17 95 +stairs:stair_outer_slade_block 74 39 39 stairs:stair_outer_slade_brick 68 40 40 stairs:stair_outer_spore_tree_wood 210 199 170 stairs:stair_outer_tower_cap_wood 236 231 221 stairs:stair_outer_tunnel_tube_wood 157 20 98 +stairs:stair_slade_block 74 39 39 stairs:stair_slade_brick 68 40 40 stairs:stair_spore_tree_wood 210 199 170 stairs:stair_tower_cap_wood 236 231 221 -stairs:stair_tunnel_tube_wood 157 20 98 -subterrane:dry_flowstone 97 94 93 -subterrane:dry_stal_1 97 94 93 -subterrane:dry_stal_2 97 94 93 -subterrane:dry_stal_3 97 94 93 -subterrane:dry_stal_4 97 94 93 -subterrane:wet_flowstone 127 125 124 -subterrane:wet_stal_1 127 125 124 -subterrane:wet_stal_2 127 125 124 -subterrane:wet_stal_3 127 125 124 -subterrane:wet_stal_4 127 125 124 \ No newline at end of file +stairs:stair_tunnel_tube_wood 157 20 98 \ No newline at end of file diff --git a/oil/depends.txt b/oil/depends.txt deleted file mode 100644 index e3df8e9..0000000 --- a/oil/depends.txt +++ /dev/null @@ -1,5 +0,0 @@ -default -dynamic_liquid? -bucket? -doc? -basic_materials? \ No newline at end of file diff --git a/subterrane b/subterrane index 28d1aa3..4b0ae3b 160000 --- a/subterrane +++ b/subterrane @@ -1 +1 @@ -Subproject commit 28d1aa363447bce693028c70c0f6318bd94bad92 +Subproject commit 4b0ae3bce730cc88e324907e7695e719c74c913e