more structures, more to discover.

This commit is contained in:
kno10 2024-09-17 21:08:24 +02:00
parent 162749decc
commit edaf158686
9 changed files with 171 additions and 4 deletions

View file

@ -0,0 +1,71 @@
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
vl_structures.register_structure("campsite",{
place_on = {"group:grass_block"},
flags = "place_center_x, place_center_z",
chunk_probability = 50,
y_max = mcl_vars.mg_overworld_max,
y_min = 1,
prepare = { tolerance = 1, foundation = -2, clear_top = 1, padding = 1, corners = 1 }, -- low tolerance, perform little terraforming
filenames = {
modpath.."/schematics/campsite_1.mts"
},
loot = {
["mcl_chests:trapped_chest_small"] = {
{
stacks_min = 1,
stacks_max = 3,
items = {
{ itemstring = "mcl_sus_stew:stew", weight = 10, amount_min = 1, amount_max = 1 },
{ itemstring = "mcl_core:paper", weight = 8, amount_min = 1, amount_max = 12 },
{ itemstring = "mcl_farming:wheat_item", weight = 7, amount_min = 8, amount_max = 21 },
{ itemstring = "mcl_farming:carrot_item", weight = 7, amount_min = 4, amount_max = 8 },
{ itemstring = "mcl_farming:potato_item_poison", weight = 7, amount_min = 2, amount_max = 6 },
{ itemstring = "mcl_farming:potato_item", weight = 7, amount_min = 2, amount_max = 6 },
{ itemstring = "mcl_core:coal_lump", weight = 6, amount_min = 2, amount_max = 8 },
{ itemstring = "mcl_mobitems:rotten_flesh", weight = 5, amount_min = 5, amount_max = 24 },
{ itemstring = "mcl_farming:potato_item", weight = 3, amount_min = 1, amount_max = 5 },
{ itemstring = "mcl_armor:helmet_leather_enchanted", weight = 3, func = function(stack, _)
mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}) end },
{ itemstring = "mcl_armor:chestplate_leather_enchanted", weight = 3, func = function(stack, _)
mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}) end },
{ itemstring = "mcl_armor:leggings_leather_enchanted", weight = 3, func = function(stack, _)
mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}) end },
{ itemstring = "mcl_armor:boots_leather_enchanted", weight = 3, func = function(stack, _)
mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}) end },
{ itemstring = "mcl_bamboo:bamboo", weight = 2, amount_min = 1, amount_max = 3 },
{ itemstring = "mcl_farming:pumpkin", weight = 2, amount_min = 1, amount_max = 3 },
{ itemstring = "mcl_tnt:tnt", weight = 1, amount_min = 1, amount_max = 2 },
}
},
{
stacks_min = 1,
stacks_max = 2,
items = {
{ itemstring = "mcl_core:iron_ingot", weight = 90, amount_min = 1, amount_max = 2 },
{ itemstring = "mcl_core:iron_nugget", weight = 50, amount_min = 1, amount_max = 10 },
{ itemstring = "mcl_core:emerald", weight = 40, amount_min = 1, amount_max = 5 },
{ itemstring = "mcl_core:lapis", weight = 20, amount_min = 1, amount_max = 10 },
{ itemstring = "mcl_core:gold_ingot", weight = 10, amount_min = 1, amount_max = 1 },
{ itemstring = "mcl_core:gold_nugget", weight = 10, amount_min = 1, amount_max = 4 },
{ itemstring = "mcl_experience:bottle", weight = 5, amount_min = 1, amount_max = 1 },
{ itemstring = "mcl_core:diamond", weight = 5, amount_min = 1, amount_max = 1 },
}
},{
stacks_min = 1,
stacks_max = 1,
items = {
--{ itemstring = "FIXME TREASURE MAP", weight = 8, amount_min = 1, amount_max = 5 },
{ itemstring = "mcl_core:paper", weight = 20, amount_min = 1, amount_max = 10 },
{ itemstring = "mcl_mobitems:feather", weight = 10, amount_min = 1, amount_max = 5 },
{ itemstring = "mcl_books:book", weight = 5, amount_min = 1, amount_max = 5 },
{ itemstring = "mcl_clock:clock", weight = 1, amount_min = 1, amount_max = 1 },
{ itemstring = "mcl_compass:compass", weight = 1, amount_min = 1, amount_max = 1 },
{ itemstring = "mcl_maps:empty_map", weight = 1, amount_min = 1, amount_max = 1 },
}
},
}
}
})

View file

@ -32,7 +32,7 @@ vl_structures.register_structure("desert_temple",{
place_on = {"group:sand"},
flags = "place_center_x, place_center_z",
y_offset = -12,
prepare = { padding = 3, corners = 3, foundation = true, clear = false },
prepare = { tolerance = 10, padding = 3, corners = 3, foundation = true, clear = false },
chunk_probability = 18,
y_max = mcl_vars.mg_overworld_max,
y_min = 1,

View file

@ -78,7 +78,7 @@ local function igloo_callback(cpos,def,pr,p1,p2,size,rotation)
end
local path = modpath.."/schematics/mcl_structures_igloo_basement.mts"
vl_structures.place_schematic(bpos, -1, path, rotation, {
force_place = true,
force_placement = true,
prepare = { tolerance = -1, foundation = false, clear = false },
after_place = function(_, _, pr, p1, p2)
-- Generate ladder to basement

View file

@ -27,6 +27,7 @@ mcl_structures.register_structure = function(name, def, nospawn)
vl_structures.register_structure(name, def)
end
dofile(modpath.."/campsite.lua")
dofile(modpath.."/desert_temple.lua")
dofile(modpath.."/desert_well.lua")
dofile(modpath.."/end_city.lua")
@ -40,6 +41,7 @@ dofile(modpath.."/ocean_temple.lua")
dofile(modpath.."/pillager_outpost.lua")
dofile(modpath.."/ruined_portal.lua")
dofile(modpath.."/shipwrecks.lua")
dofile(modpath.."/spider_cocoon.lua")
dofile(modpath.."/witch_hut.lua")
dofile(modpath.."/woodland_mansion.lua")

View file

@ -81,7 +81,7 @@ vl_structures.register_structure("ocean_temple",{
flags = "absvalue",
},
flags = "force_placement",
force_place = true,
force_placement = true,
prepare = { tolerance = 8, clear = false, foundation = 3, mode="water" },
biomes = ocean_biomes,
y_max = water_level-4,

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,94 @@
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
vl_structures.register_structure("cocoon",{
place_on = {"group:material_stone"},
flags = "place_center_x, place_center_z, all_floors",
chunk_probability = 20,
y_max = -10,
y_min = mcl_vars.mg_overworld_min,
y_offset = 2,
spawn_by = "air",
check_offset = 1,
num_spawn_by = 6,
force_placement = false,
prepare = { foundation = false, clear = false, clear_top = 0, padding = -1, corners = 1 }, -- TODO: make clear/foundation not use grass
filenames = {
modpath.."/schematics/cocoon_1.mts"
},
after_place = function(p,def,pr,p1,p2)
if mcl_mobspawners then
local spawner = minetest.find_nodes_in_area(p1,p2,{"mcl_mobspawners:spawner"})
if #spawner > 0 then
mcl_mobspawners.setup_spawner(spawner[1], "mobs_mc:cave_spider", 0, 7, 4, 15, -3)
end
end
-- p2.y is the top slice only, not a typo, we look for the rope
local cs = minetest.find_nodes_in_area(vector.new(p1.x,p2.y,p1.z), p2, "mcl_wool:white")
local rope = {}
-- TODO: port to VoxelManip?
for _,c in pairs(cs) do
while true do
c = vector.offset(c,0,1,0)
local name = minetest.get_node(c).name
if name == "ignore" then break end
if name ~= "air" then break end
table.insert(rope,c)
end
end
minetest.bulk_swap_node(rope, {name = "mcl_wool:white", param2 = 2})
-- remove some of the spiderwebs to add variation
local ws = minetest.find_nodes_in_area(p1, p2, "mcl_core:cobweb")
local clear = {}
for i = 1,math.floor(#ws/4) do
if #ws == 0 then break end
local idx = pr:next(1,#ws)
table.insert(clear, ws[idx])
table.remove(ws, idx)
end
minetest.bulk_swap_node(clear, {name = "air"})
end,
loot = {
["mcl_chests:chest_small"] = {
{
stacks_min = 2,
stacks_max = 4,
items = {
{ itemstring = "mcl_mobitems:bone", weight = 10, amount_min = 2, amount_max = 4 },
{ itemstring = "mcl_farming:potato_item_poison", weight = 7, amount_min = 2, amount_max = 6 },
{ itemstring = "mcl_mobitems:rotten_flesh", weight = 5, amount_min = 5, amount_max = 24 },
{ itemstring = "mcl_farming:potato_item", weight = 3, amount_min = 1, amount_max = 5 },
{ itemstring = "mcl_tnt:tnt", weight = 1, amount_min = 1, amount_max = 2 },
}
},
{
stacks_min = 2,
stacks_max = 4,
items = {
{ itemstring = "mcl_core:iron_ingot", weight = 90, amount_min = 1, amount_max = 2 },
{ itemstring = "mcl_core:iron_nugget", weight = 50, amount_min = 1, amount_max = 10 },
{ itemstring = "mcl_core:emerald", weight = 40, amount_min = 1, amount_max = 5 },
{ itemstring = "mcl_core:lapis", weight = 20, amount_min = 1, amount_max = 10 },
{ itemstring = "mcl_core:gold_ingot", weight = 10, amount_min = 1, amount_max = 1 },
{ itemstring = "mcl_core:gold_nugget", weight = 10, amount_min = 1, amount_max = 4 },
{ itemstring = "mcl_experience:bottle", weight = 5, amount_min = 1, amount_max = 1 },
{ itemstring = "mcl_core:diamond", weight = 5, amount_min = 1, amount_max = 1 },
}
},{
stacks_min = 1,
stacks_max = 1,
items = {
--{ itemstring = "FIXME TREASURE MAP", weight = 8, amount_min = 1, amount_max = 5 },
{ itemstring = "mcl_core:paper", weight = 20, amount_min = 1, amount_max = 10 },
{ itemstring = "mcl_mobitems:bone", weight = 10, amount_min = 2, amount_max = 4 },
{ itemstring = "mcl_mobitems:rotten_flesh", weight = 5, amount_min = 3, amount_max = 8 },
{ itemstring = "mcl_books:book", weight = 5, amount_min = 1, amount_max = 1 },
{ itemstring = "mcl_clock:clock", weight = 1, amount_min = 1, amount_max = 1 },
{ itemstring = "mcl_compass:compass", weight = 1, amount_min = 1, amount_max = 1 },
{ itemstring = "mcl_maps:empty_map", weight = 1, amount_min = 1, amount_max = 1 },
}
},
}
}
})

View file

@ -256,7 +256,7 @@ function vl_terraforming.find_level_vm(vm, cpos, size, tolerance, mode)
return cpos, surface_material
end
-- well supported base, not too uneven?
if #ys < 4 or min(ys[#ys-1]-ys[1], ys[#ys]-ys[2]) > tolerance then
if #ys < 5 or min(ys[#ys-1]-ys[1], ys[#ys]-ys[2]) > tolerance then
-- minetest.log("action", "[vl_terraforming] ground too uneven: "..#ys.." positions: "..({dump(ys):gsub("[\n\t ]+", " ")})[1]
-- .." tolerance "..tostring(#ys > 2 and min(ys[#ys-1]-ys[1], ys[#ys]-ys[2])).." > "..tolerance)
return nil, nil