Mineclone compatibility (#36)

* latest versions of mapgen_helper and subterrane

* initial work

* call it "minetest_game" compatibility instead of "default" compatibility

* Getting started on moving all default dependencies to a single root mod

* distilling out more dependencies

* fix some typos

* more default dependencies

* beds

* start getting some MCL equivalents set up

* mine gas dependencies

* reorganize

* add some mapgen stuff

* getting close to actually being able to run mineclone with this

* it actually runs! Crashes with out-of-memory error when you try to go below -64, but it's a start.

* hide flowing pit plasma from creative inventory

* mineclone 5 settings

* Update subterrane

* get rid of meselamp dependency, bring in ancient lanterns from deep roads

* stair dependencies

* add mcl fences

* add mcl blast resistance and hardness to everything. Also an alternate name for Nethercap in MCL, since "nether" has another meaning there.

* buckets of oil and syrup should work in mineclone now

* 'splosions!

* make hunters avoid repaired ancient lanterns

* mapgen torchspine wasn't having its timer set

* split mapgen compatibility code into its own file

* bypass dependency indirection for df_farming.

* apply threshold alpha to food items, they look better that way

* bypass dependency indirection for df_mapitems

* bypass dependency indirection for df_primordial_items

* bypass dependency indirection for df_trees

* bypass dependency indirection for df_underworld_items

* bypass dependency indirection for df_caverns

* fixing up the puzzle seal to work in both

* fix puzzle seal formspec for mcl

* create built-in substitutes for fireflies and bones mods for when those aren't available

* set up mcl dungeon loot for underworld warriors, port over some translations from default

* overlooked a debug

* add itemslot backgrounds for mcl

* added mineclone groups to all registered nodes. TODO: craftitems.

This was extremely tedious. Completely untested, aside from simply running the game.

* minor fixes to the built-in bones node

* eatable group for edibles

* clean up some TODOs

* adjust pit plasma abm conditions

* add df_ambience

* fixing up explosions. Also make slade sand diggable in mcl, and fix a bug in web generators

* make tower cap caves less chirpy, fix bigger goblin hut schematic, allow glowing spindlestem extract bottles

* avoid an undeclared global check

* alas, cave pearls aren't set up right for attached_node_facedir.

* bunch of work on mineclone ores, moved main config into df_dependencies

* add a few more ores

* update depends in mod.conf

* add opaque group to light-sensitive dirt types

Mineclone adds the "opaque" group only to non-light nodes, and torches check for the opaque group to decide whether they can be placed there. light-sensitive nodes need the "light" paramtype to work, though. So adding the opaque group manually to these.

* add a touch of reverb to one of the whisper tracks, it didn't fit with the others without it

* bloodthorn also needs to be set opaque

* add sound to torchspines

* isolate Nethercap translation name to make it easier to swap out in Mineclone contexts

* ambience tweak

* fix dirt spreads

https://github.com/FaceDeer/dfcaverns/issues/35

* adding achievements! Almost all untested yet.

* fix a few achievements glitches

* tweak some more achievements, add delay when achievements unlock other achievements

* fix farming achievements, fix spindlestem callbacks on place

* icons for farming achievements

* more achievement icons, fix ancient lantern achievement

* two more icons, update text

* add icons for upper cavern layers

* all achievements have icons now. Also add another sound to the magma sea ambience

* hook into awards' trigger system to get "x/y" progress displayed for the multi-achievement achievements

* ironically, Mineclone has an old version of awards that is incompatible with my trigger work.

* every award should now have a description and a difficulty.

* removing leftovers

* missing callbacks for farmables

* put growth restrictions on farmables so the achievement doesn't trigger inappropriately.

* enable ores in MCL2, fix some undeclared globals, fix icecap growth in MCL (achievements are a good debugging tool)

* get *all* the copper and iron containing nodes

* fix old awards mod's handling of grouped dig items

* Add a little bonus for players who activate a slade breacher - a handheld 'splosion tool

* used the wrong drop method

* beef up explosions in MCL, make slade brick craftable from slade sand and lava

* better creative mode checks, fix crash when digging walls in MCL

* Update subterrane

* various bugfixes and tweaks

* whipping up a simple puzzle chest to give a clue about ancient numbering

The coding is done, but UI and a node mesh need to be done

* prepare for some art tomorrow

* chest node and sounds

* images for the combination dials

* add puzzle chests to the underworld buildings

* update translations

* oops, can't initialize the contents of puzzle chests every time or players get endless stuff

* add backgrounds to item slots in MCL

* wrap the existing function rather than copy and pasting it

* fix bucket dependency in cooking recipes

* add _mcl_saturation to edibles
This commit is contained in:
FaceDeer
2022-08-28 23:48:44 -06:00
committed by GitHub
parent b2ee829c1a
commit 0a0c97b74e
435 changed files with 6100 additions and 1367 deletions

View File

@ -1,57 +0,0 @@
local CONFIG_FILE_PREFIX = "dfcaverns_"
df_caverns.config = {}
local print_settingtypes = false
local function setting(stype, name, default, description)
local value
if stype == "bool" then
value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name, default)
elseif stype == "string" then
value = minetest.settings:get(CONFIG_FILE_PREFIX..name)
elseif stype == "int" or stype == "float" then
value = tonumber(minetest.settings:get(CONFIG_FILE_PREFIX..name))
end
if value == nil then
value = default
end
df_caverns.config[name] = value
if print_settingtypes then
minetest.debug(CONFIG_FILE_PREFIX..name.." ("..description..") "..stype.." "..tostring(default))
end
end
--Caverns
setting("float", "vertical_cavern_scale", 256, "Vertical cavern dimension scale")
setting("float", "horizontal_cavern_scale", 256, "Horizontal cavern dimension scale")
setting("float", "cavern_threshold", 0.5, "Cavern threshold")
setting("float", "sunless_sea_threshold", 0.4, "Cavern threshold for sunless seas (higher number means sparser caverns)")
setting("float", "tunnel_flooding_threshold", 0.25, "Threshold for flooding tunnels around flooded caverns")
setting("int", "ymax", -193, "Upper limit of level 1")
setting("int", "level1_min", -832, "Upper limit of level 2")
setting("int", "level2_min", -1472, "Upper limit of level 3")
setting("int", "level3_min", -2112, "Upper limit of the sunless seas")
setting("int", "sunless_sea_min", -2512, "Lower limit of the sunless seas")
setting("bool", "enable_oil_sea", true, "Enable oil sea")
df_caverns.config.enable_oil_sea = df_caverns.config.enable_oil_sea and minetest.get_modpath("oil") ~= nil
setting("int", "oil_sea_level", -2700, "Oil sea level")
setting("bool", "enable_lava_sea", true, "Enable magma sea")
setting("int", "lava_sea_level", -2900, "Lava sea level")
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")
setting("bool", "restrict_trees_to_biomes", false, "Restrict underground tree growth to their home biomes")
setting("bool", "restrict_farmables_to_biomes", false, "Restrict underground farmable plant growth to their home biomes")

View File

@ -45,18 +45,19 @@ end
if minetest.get_modpath("bones_loot") and df_caverns.config.enable_underworld then
if minetest.get_modpath("default") then
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,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 = "flowers:tulip_black", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}},
{name = "flowers:dandelion_white", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}},
{name = "flowers:dandelion_yellow", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}},
{name = "flowers:rose", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}},
{name = "flowers:tulip", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}},
{name = "flowers:chrysanthemum_green", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}},
{name = "flowers:geranium", chance = 0.1, 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
@ -105,10 +106,51 @@ bones_loot.register_loot({
{name = "default:ladder_steel", chance = 0.2, count = {1,5}, types = {"underworld_warrior"}},
{name = "default:meselamp", chance = 0.1, count = {1,2}, types = {"underworld_warrior"}},
{name = "default:mese_post_light", chance = 0.25, count = {1,5}, types = {"underworld_warrior"}},
})
end
if minetest.get_modpath("mcl_core") then
bones_loot.register_loot({
-- Taken from the ruined portal loot table in mcl
{name = "mcl_core:iron_nugget", types = {"underworld_warrior"}, chance = 40/50, count ={9, 18}},
{name = "mcl_core:flint", types = {"underworld_warrior"}, chance = 40/50, count ={9, 18}},
{name = "mcl_core:obsidian", types = {"underworld_warrior"}, chance = 40/50, count ={1, 2}},
{name = "mcl_fire:fire_charge", types = {"underworld_warrior"}, chance = 40/50, count ={1, 1}},
{name = "mcl_fire:flint_and_steel", types = {"underworld_warrior"}, chance = 40/50, count ={1, 1}},
{name = "mcl_core:gold_nugget", types = {"underworld_warrior"}, chance = 15/50, count ={4, 24}},
{name = "mcl_core:apple_gold", types = {"underworld_warrior"}, chance = 15/50, count ={1, 1}},
{name = "mcl_tools:axe_gold", types = {"underworld_warrior"}, chance = 15/50, count ={1, 1}},
{name = "mcl_farming:hoe_gold", types = {"underworld_warrior"}, chance = 15/50, count ={1, 1}},
{name = "mcl_tools:pick_gold", types = {"underworld_warrior"}, chance = 15/50, count ={1, 1}},
{name = "mcl_tools:shovel_gold", types = {"underworld_warrior"}, chance = 15/50, count ={1, 1}},
{name = "mcl_tools:sword_gold", types = {"underworld_warrior"}, chance = 15/50, count ={1, 1}},
{name = "mcl_armor:helmet_gold", types = {"underworld_warrior"}, chance = 15/50, count ={1, 1}},
{name = "mcl_armor:chestplate_gold", types = {"underworld_warrior"}, chance = 15/50, count ={1, 1}},
{name = "mcl_armor:leggings_gold", types = {"underworld_warrior"}, chance = 15/50, count ={1, 1}},
{name = "mcl_armor:boots_gold", types = {"underworld_warrior"}, chance = 15/50, count ={1, 1}},
{name = "mcl_potions:speckled_melon", types = {"underworld_warrior"}, chance = 5/50, count ={4, 12}},
{name = "mcl_farming:carrot_item_gold", types = {"underworld_warrior"}, chance = 5/50, count ={4, 12}},
{name = "mcl_core:gold_ingot", types = {"underworld_warrior"}, chance = 5/50, count ={2, 8}},
{name = "mcl_clock:clock", types = {"underworld_warrior"}, chance = 5/50, count ={1,1}},
{name = "mesecons_pressureplates:pressure_plate_gold_off", types = {"underworld_warrior"}, chance = 5/50, count ={1,1}},
{name = "mobs_mc:gold_horse_armor", types = {"underworld_warrior"}, chance = 5/50, count ={1,1}},
{name = "mcl_bells:bell", types = {"underworld_warrior"}, chance = 1/50, count ={1,1}},
{name = "mcl_core:apple_gold_enchanted", types = {"underworld_warrior"}, chance = 1/50, count ={1,1}},
})
for flower_name, _ in pairs(mcl_flowers.registered_simple_flowers) do
bones_loot.register_loot({
{name = flower_name, chance = 0.1, count = {1,1}, types = {"underworld_warrior"}},
})
end
end
bones_loot.register_loot({
{name = "ice_sprites:ice_sprite_bottle", chance = 0.025, count = {1, 1}, types = {"underworld_warrior"}},
{name = "df_underworld_items:glow_amethyst", chance = 0.25, count = {1, 2}, types = {"underworld_warrior"}},
})
})
if df_caverns.config.enable_lava_sea then
bones_loot.register_loot({name = "df_mapitems:mese_crystal", chance = 0.25, count = {1, 2}, types = {"underworld_warrior"}})

View File

@ -1,11 +1,10 @@
df_caverns = {}
df_caverns.config = df_dependencies.config
--grab a shorthand for the filepath of the mod
local modpath = minetest.get_modpath(minetest.get_current_modname())
--load companion lua files
dofile(modpath.."/config.lua")
dofile(modpath.."/node_ids.lua")
dofile(modpath.."/shared.lua")

View File

@ -53,6 +53,13 @@ local wave_mult = 10
local y_max = median + 2*wave_mult + -2*ceiling_mult + ceiling_displace
local y_min = median - 2*wave_mult - 2*floor_mult + floor_displace
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y > y_max or pos.y < y_min then
return
end
return "lava_sea"
end)
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

View File

@ -46,7 +46,7 @@ local get_biome = function(heat, humidity)
end
end
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.level1_min or pos.y > df_caverns.config.ymax then
return nil
end

View File

@ -47,7 +47,7 @@ local get_biome = function(heat, humidity)
end
end
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.level2_min or pos.y >= df_caverns.config.level1_min then
return nil
end

View File

@ -41,7 +41,7 @@ local get_biome = function(heat, humidity)
end
end
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.level3_min or pos.y >= df_caverns.config.level2_min then
return nil
end

View File

@ -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, named_waypoints, name_generator, fireflies, chasms, big_webs
depends = df_dependencies, subterrane, df_trees, df_mapitems
optional_depends = df_farming, ice_sprites, oil, df_underworld_items, magma_conduits, bones_loot, named_waypoints, name_generator, fireflies, chasms, big_webs, mcl_flowers

View File

@ -1,41 +1,41 @@
df_caverns.node_id = {}
minetest.after(1, function() df_caverns.node_id = nil end) -- should only be used during initialization.
minetest.after(0, function() df_caverns.node_id = nil end) -- should only be used during initialization.
if minetest.get_modpath("ice_sprites") then
df_caverns.node_id.sprite = minetest.get_content_id("ice_sprites:ice_sprite")
if df_dependencies.node_name_fireflies then
df_caverns.node_id.fireflies = minetest.get_content_id(df_dependencies.node_name_fireflies)
end
if minetest.get_modpath("fireflies") then
df_caverns.node_id.fireflies = minetest.get_content_id("fireflies:firefly")
end
if minetest.get_modpath("df_farming") then
df_caverns.node_id.dead_fungus = minetest.get_content_id("df_farming:dead_fungus")
end
df_caverns.node_id.cobble = minetest.get_content_id(df_dependencies.node_name_cobble)
df_caverns.node_id.desert_sand = minetest.get_content_id(df_dependencies.node_name_desert_sand)
df_caverns.node_id.dirt = minetest.get_content_id(df_dependencies.node_name_dirt)
df_caverns.node_id.gravel = minetest.get_content_id(df_dependencies.node_name_gravel)
df_caverns.node_id.ice = minetest.get_content_id(df_dependencies.node_name_ice)
df_caverns.node_id.lava = minetest.get_content_id(df_dependencies.node_name_lava_source)
df_caverns.node_id.meseore = minetest.get_content_id(df_dependencies.node_name_stone_with_mese)
df_caverns.node_id.mossycobble = minetest.get_content_id(df_dependencies.node_name_mossycobble)
df_caverns.node_id.obsidian = minetest.get_content_id(df_dependencies.node_name_obsidian)
df_caverns.node_id.sand = minetest.get_content_id(df_dependencies.node_name_sand)
df_caverns.node_id.silver_sand = minetest.get_content_id(df_dependencies.node_name_silver_sand)
df_caverns.node_id.snow = minetest.get_content_id(df_dependencies.node_name_snow)
df_caverns.node_id.stone = minetest.get_content_id(df_dependencies.node_name_stone)
df_caverns.node_id.stone_with_coal = minetest.get_content_id(df_dependencies.node_name_stone_with_coal)
df_caverns.node_id.water = minetest.get_content_id(df_dependencies.node_name_water_source)
if minetest.get_modpath("big_webs") then
df_caverns.node_id.big_webs = minetest.get_content_id("big_webs:webbing")
df_caverns.node_id.big_webs_egg = minetest.get_content_id("big_webs:web_egg")
end
df_caverns.node_id.air = minetest.get_content_id("air")
if minetest.get_modpath("ice_sprites") then
df_caverns.node_id.sprite = minetest.get_content_id("ice_sprites:ice_sprite")
end
df_caverns.node_id.cobble = minetest.get_content_id("default:cobble")
df_caverns.node_id.desert_sand = minetest.get_content_id("default:desert_sand")
df_caverns.node_id.dirt = minetest.get_content_id("default:dirt")
df_caverns.node_id.gravel = minetest.get_content_id("default:gravel")
df_caverns.node_id.ice = minetest.get_content_id("default:ice")
df_caverns.node_id.lava = minetest.get_content_id("default:lava_source")
df_caverns.node_id.meseore = minetest.get_content_id("default:stone_with_mese")
df_caverns.node_id.mossycobble = minetest.get_content_id("default:mossycobble")
df_caverns.node_id.obsidian = minetest.get_content_id("default:obsidian")
df_caverns.node_id.sand = minetest.get_content_id("default:sand")
df_caverns.node_id.silver_sand = minetest.get_content_id("default:silver_sand")
df_caverns.node_id.snow = minetest.get_content_id("default:snow")
df_caverns.node_id.stone = minetest.get_content_id("default:stone")
df_caverns.node_id.stone_with_coal = minetest.get_content_id("default:stone_with_coal")
df_caverns.node_id.water = minetest.get_content_id("default:water_source")
if minetest.get_modpath("df_farming") then
df_caverns.node_id.dead_fungus = minetest.get_content_id("df_farming:dead_fungus")
end
df_caverns.node_id.air = minetest.get_content_id("air")
df_caverns.node_id.cobble_fungus = minetest.get_content_id("df_mapitems:cobble_with_floor_fungus")
df_caverns.node_id.cobble_fungus_fine = minetest.get_content_id("df_mapitems:cobble_with_floor_fungus_fine")

View File

@ -46,6 +46,13 @@ local c_lava_set
local y_max = median + 2*wave_mult + 2*ceiling_mult + ceiling_displace
local y_min = median - 2*wave_mult + 2*floor_mult + floor_displace
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y > y_max or pos.y < y_min then
return
end
return "oil_sea"
end)
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
@ -115,7 +122,7 @@ end)
minetest.register_ore({
ore_type = "scatter",
ore = "mine_gas:gas_seep",
wherein = "default:stone",
wherein = df_dependencies.node_name_stone,
clust_scarcity = 32 * 32 * 32,
clust_num_ores = 27,
clust_size = 6,

View File

@ -29,7 +29,7 @@ local perlin_wave_primordial = {
local giant_mycelium_timer_spread = tonumber(minetest.settings:get("dcaverns_giant_mycelium_timer_spread")) or 10
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.primordial_min or pos.y > df_caverns.config.primordial_max then
return nil
end
@ -194,6 +194,7 @@ local jungle_cavern_floor = function(abs_cracks, humidity, vi, area, data, data_
local firefly_vi = vi + ystride * math.random(1, 5)
if data[firefly_vi] == c_air then
data[firefly_vi] = c_fireflies
minetest.get_node_timer(area:position(firefly_vi)):start(1)
end
end
end
@ -262,6 +263,7 @@ local jungle_warren_floor = function(abs_cracks, vi, area, data, data_param2)
local firefly_vi = vi + ystride * math.random(1, 5)
if data[firefly_vi] == c_air then
data[firefly_vi] = c_fireflies
minetest.get_node_timer(area:position(firefly_vi)):start(1)
end
end
end
@ -395,7 +397,7 @@ subterrane.register_layer({
columns = {
maximum_radius = 20,
minimum_radius = 5,
node = "default:stone", -- no flowstone below the Sunless Sea, replace with something else
node = df_dependencies.node_name_stone, -- no flowstone below the Sunless Sea, replace with something else
weight = 0.5,
maximum_count = 60,
minimum_count = 10,

View File

@ -1,35 +1,49 @@
local outer_stair = "stairs:stair_outer_slade_brick"
if stairs.register_stair_outer == nil then -- 0.4.16 compatibility
outer_stair = "df_underworld_items:slade_brick"
end
local n1 = { name = "df_underworld_items:slade_block", force_place=true }
local n2 = { name = outer_stair, param2 = 1, force_place=true }
local n3 = { name = "stairs:stair_slade_brick", force_place=true }
local n4 = { name = outer_stair, force_place=true }
local n2 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 1, force_place=true }
local n3 = { name = df_dependencies.node_name_stair_slade_brick, force_place=true }
local n4 = { name = df_dependencies.node_name_stair_outer_slade_brick, force_place=true }
local n5 = { name = "air", force_place=true }
local n6 = { name = "df_underworld_items:slade_seal", force_place=true }
local n7 = { name = "stairs:stair_slade_brick", param2 = 1, force_place=true }
local n7 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 1, force_place=true }
local n8 = { name = "df_underworld_items:slade_brick", force_place=true }
local n9 = { name = "stairs:stair_slade_brick", param2 = 3, force_place=true }
local n9 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 3, force_place=true }
local n10 = { name = "df_underworld_items:slade_wall", force_place=true }
local n11 = { name = "default:meselamp", force_place=true }
local n12 = { name = outer_stair, param2 = 2, force_place=true }
local n13 = { name = "stairs:stair_slade_brick", param2 = 2, force_place=true }
local n14 = { name = outer_stair, param2 = 3, force_place=true }
local n11 = { name = "df_underworld_items:ancient_lantern_slade_worn", prob=192 } -- 50% chance of being force-placed
local n12 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 2, force_place=true }
local n13 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 2, force_place=true }
local n14 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 3, force_place=true }
return {
name = "df_caverns:lamppost",
size = {x = 3, y = 15, z = 3},
center_pos = {x = 1, y = 7, z = 1},
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, n2, n3, n4, n5, n5, n5, n5, n5, n5, n5,
n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n1, n1, n1, n1, n5, n1,
n1, n5, n1, n1, n5, n1, n1, n5, n1, n1, n5, n1, n1, n5, n1, n1, n6,
n1, n7, n8, n9, n5, n8, n5, n5, n8, n5, n5, n10, n5, n5, n10, n5, n5,
n11, n5, n5, n5, n5, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n12, n13, n14, n5,
n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5,
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, n3, n4,
n5, n5, n5,
n5, n5, n5,
n5, n5, n5,
n5, n5, n5,
n5, n11, n5,
n5, n5, n5,
n1, n1, n1, n1, n5, n1, n1, n5, n1,
n1, n5, n1, n1, n5, n1, n1, n5, n1,
n1, n5, n1, n1, n6, n1, n7, n8, n9,
n5, n8, n5,
n5, n8, n5,
n5, n10, n5,
n5, n10, n5,
n11, n10, n11,
n5, n5, n5,
n1, n1, n1, n1, n1, n1, n1, n1, n1,
n1, n1, n1, n1, n1, n1, n1, n1, n1,
n1, n1, n1, n1, n1, n1, n12, n13, n14,
n5, n5, n5,
n5, n5, n5,
n5, n5, n5,
n5, n5, n5,
n5, n11, n5,
n5, n5, n5,
}
}

View File

@ -1,28 +1,23 @@
local outer_stair = "stairs:stair_outer_slade_brick"
if stairs.register_stair_outer == nil then -- 0.4.16 compatibility
outer_stair = "df_underworld_items:slade_brick"
end
local n1 = { name = "ignore"}
local n8 = { name = "air", force_place=true }
local n3 = { name = "df_underworld_items:slade_brick", force_place=true }
local n4 = { name = "df_underworld_items:slade_wall", force_place=true }
local n5 = { name = outer_stair, param2 = 1, force_place=true }
local n6 = { name = "stairs:stair_slade_brick", force_place=true }
local n7 = { name = outer_stair, force_place=true }
local n9 = { name = "stairs:slab_slade_brick", param2 = 23, force_place=true }
local n10 = { name = "stairs:stair_slade_brick", param2 = 1, force_place=true }
local n11 = { name = "stairs:stair_slade_brick", param2 = 3, force_place=true }
local n14 = { name = "stairs:stair_slade_brick", param2 = 23, force_place=true }
local n15 = { name = outer_stair, param2 = 2, force_place=true }
local n16 = { name = "stairs:stair_slade_brick", param2 = 2, force_place=true }
local n17 = { name = outer_stair, param2 = 3, force_place=true }
local n5 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 1, force_place=true }
local n6 = { name = df_dependencies.node_name_stair_slade_brick, force_place=true }
local n7 = { name = df_dependencies.node_name_stair_outer_slade_brick, force_place=true }
local n9 = { name = df_dependencies.node_name_slab_slade_brick, param2 = 23, force_place=true }
local n10 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 1, force_place=true }
local n11 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 3, force_place=true }
local n14 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 23, force_place=true }
local n15 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 2, force_place=true }
local n16 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 2, force_place=true }
local n17 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 3, force_place=true }
-- foundation nodes
local n2 = { name = "df_underworld_items:slade_brick", force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n12 = { name = "df_underworld_items:slade_wall", force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n13 = { name = "stairs:stair_slade_brick", param2 = 1, force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n13 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 1, force_place=false, place_on_condition=mapgen_helper.buildable_to }
return {

View File

@ -1,19 +1,14 @@
local outer_stair = "stairs:stair_outer_slade_brick"
if stairs.register_stair_outer == nil then -- 0.4.16 compatibility
outer_stair = "df_underworld_items:slade_brick"
end
local n1 = { name = "df_underworld_items:slade_block", force_place=true }
local n2 = { name = outer_stair, param2 = 1, force_place=true }
local n3 = { name = "stairs:stair_slade_brick", force_place=true }
local n4 = { name = outer_stair, force_place=true }
local n2 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 1, force_place=true }
local n3 = { name = df_dependencies.node_name_stair_slade_brick, force_place=true }
local n4 = { name = df_dependencies.node_name_stair_outer_slade_brick, force_place=true }
local n5 = { name = "air", force_place=true }
local n6 = { name = "df_underworld_items:slade_seal", force_place=true }
local n7 = { name = "stairs:stair_slade_brick", param2 = 1, force_place=true }
local n8 = { name = "stairs:stair_slade_brick", param2 = 3, force_place=true }
local n9 = { name = outer_stair, param2 = 2, force_place=true }
local n10 = { name = "stairs:stair_slade_brick", param2 = 2, force_place=true }
local n11 = { name = outer_stair, param2 = 3, force_place=true }
local n7 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 1, force_place=true }
local n8 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 3, force_place=true }
local n9 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 2, force_place=true }
local n10 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 2, force_place=true }
local n11 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 3, force_place=true }
return {
name="df_caverns:oubliette",

View File

@ -1,28 +1,26 @@
local outer_stair = "stairs:stair_outer_slade_brick"
if stairs.register_stair_outer == nil then -- 0.4.16 compatibility
outer_stair = "df_underworld_items:slade_brick"
end
local n1 = { name = "ignore" }
local n10 = { name = "air", force_place=true }
local n3 = { name = "df_underworld_items:slade_brick", force_place=true }
local n4 = { name = "df_underworld_items:slade_wall", force_place=true }
local n5 = { name = outer_stair, param2 = 1, force_place=true }
local n6 = { name = "stairs:stair_slade_brick", force_place=true }
local n7 = { name = outer_stair, force_place=true }
local n11 = { name = "stairs:stair_slade_brick", param2 = 1, force_place=true }
local n12 = { name = "stairs:slab_slade_brick", param2 = 22, force_place=true}
local n13 = { name = "stairs:stair_slade_brick", param2 = 3, force_place=true }
local n15 = { name = outer_stair, param2 = 2, force_place=true }
local n16 = { name = "stairs:stair_slade_brick", param2 = 2, force_place=true }
local n17 = { name = outer_stair, param2 = 3, force_place=true }
local n5 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 1, force_place=true }
local n6 = { name = df_dependencies.node_name_stair_slade_brick, force_place=true }
local n7 = { name = df_dependencies.node_name_stair_outer_slade_brick, force_place=true }
local n11 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 1, force_place=true }
local n12 = { name = df_dependencies.node_name_slab_slade_brick, param2 = 22, force_place=true}
local n13 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 3, force_place=true }
local n15 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 2, force_place=true }
local n16 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 2, force_place=true }
local n17 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 3, force_place=true }
-- foundation nodes
local n2 = { name = "df_underworld_items:slade_brick", force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n8 = { name = "stairs:stair_slade_brick", param2 = 2, force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n9 = { name = "stairs:stair_slade_brick", force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n14 = { name = "stairs:stair_slade_brick", param2 = 1, force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n8 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 2, force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n9 = { name = df_dependencies.node_name_stair_slade_brick, force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n14 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 1, force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n18 = { name = "df_underworld_items:puzzle_chest_closed", param2 = 1, prob=192 } -- 50% chance of being force-placed.
return {
name = "df_caverns:small_building",
@ -51,7 +49,7 @@ return {
n2, n2, n2, n2, n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n2, n1, n1,
n1, n2, n2, n2, n2, n2, n2, n2, n2, n1, n1, n1, n2, n2, n2, n2, n2,
n2, n2, n2, n1, n1, n1, n2, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1,
n10, n10, n10, n10, n10, n10, n10, n4, n1, n1, n1, n10, n10, n10,
n10, n10, n10, n10, n10, n10, n18, n4, n1, n1, n1, n10, n10, n10,
n10, n10, n10, n10, n4, n1, n1, n1, n1, n11, n12, n12, n12, n12, n12,
n13, n1, n1, n2, n2, n2, n2, n2, n2, n2, n2, n2, n1, n1, n2, n2, n2,
n2, n2, n2, n2, n2, n2, n1, n1, n9, n2, n2, n2, n2, n2, n2, n2, n2,

View File

@ -1,15 +1,10 @@
local inner_stair = "stairs:stair_inner_slade_brick"
if stairs.register_stair_inner == nil then -- 0.4.16 compatibility
inner_stair = "df_underworld_items:slade_brick"
end
local n1 = { name = "df_underworld_items:slade_brick", force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n2 = { name = inner_stair, param2 = 1, force_place=true }
local n3 = { name = inner_stair, force_place=true }
local n2 = { name = df_dependencies.node_name_stair_inner_slade_brick, param2 = 1, force_place=true }
local n3 = { name = df_dependencies.node_name_stair_inner_slade_brick, force_place=true }
local n4 = { name = "df_underworld_items:slade_brick", force_place=true }
local n5 = { name = inner_stair, param2 = 2, force_place=true }
local n6 = { name = inner_stair, param2 = 3, force_place=true }
local n5 = { name = df_dependencies.node_name_stair_inner_slade_brick, param2 = 2, force_place=true }
local n6 = { name = df_dependencies.node_name_stair_inner_slade_brick, param2 = 3, force_place=true }
return {
name = "df_caverns:small_slab",

View File

@ -1,81 +0,0 @@
[Cavern dimensions]
#Note that this doesn't guarantee caverns of this setting's size. This setting
#affects the scale of features in the perlin noise that is used to build caverns.
#Most caverns will be smaller than this (and a few might be larger)
dfcaverns_vertical_cavern_scale (Vertical cavern dimension scale) float 256
#Note that this doesn't guarantee caverns of this setting's size. This setting
#affects the scale of features in the perlin noise that is used to build caverns.
#Most caverns will be smaller than this (and a few might be larger)
dfcaverns_horizontal_cavern_scale (Horizontal cavern dimension scale) float 256
#Determines threshold for cave generation. Higher number means sparser, smaller caverns
dfcaverns_cavern_threshold (Cavern threshold) float 0.5 0.0 1.0
#Determines threshold for lower sea cave generation. Higher number means sparser, smaller caverns
dfcaverns_sunless_sea_threshold (Cavern threshold for sunless sea) float 0.4 0.0 1.0
#Determines how far out water extends into tunnels below the 'sea level' of from flooded
#caverns. Lower numbers give more flooded tunnel. If this number equals the cavern
#threshold tunnels will not be flooded at all, if it is 0 then half the tunnels will be flooded.
dfcaverns_tunnel_flooding_threshold (Tunnel flooding threshold) float 0.25 0.0 1.0
[Cavern depth borders]
#maximum boundary for cavern depths are most efficient when they fit the formula (x*80-32-1)
#where x is an integer. That way you don't get map blocks that straddle two cavern layers.
dfcaverns_ymax (Upper limit of level 1) int -193
#minimum boundaries for cavern depths are most efficient when they fit the formula (x*80-32)
#where x is an integer. that way you don't get map blocks that straddle two cavern layers.
dfcaverns_level1_min (Upper limit of level 2) int -832
dfcaverns_level2_min (Upper limit of level 3) int -1472
dfcaverns_level3_min (Upper limit of the sunless sea) int -2112
dfcaverns_sunless_sea_min (Lower limit of the sunless sea) int -2512
[Lower Levels]
dfcaverns_enable_oil_sea (Generate oil sea) bool true
dfcaverns_oil_sea_level (Oil sea level) int -2700
dfcaverns_enable_lava_sea (Generate magma sea) bool true
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
[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
[Plant growth restrictions]
dfcaverns_restrict_trees_to_biomes (Restrict underground tree growth to their home biomes) bool false
dfcaverns_restrict_farmables_to_biomes (Restrict underground farmable plant growth to their home biomes) bool false

View File

@ -23,11 +23,14 @@ local c_webs_egg = df_caverns.node_id.big_webs_egg
df_caverns.data_param2 = {} -- shared among all mapgens to reduce memory clutter
df_caverns.get_biome_at_pos_list = {} -- a list of methods of the form function(pos, heat, humidity) to allow modpack-wide queries about what should grow where
local get_biome_at_pos_list = {} -- a list of methods of the form function(pos, heat, humidity) to allow modpack-wide queries about what should grow where
df_caverns.register_biome_check = function(func)
table.insert(get_biome_at_pos_list, func)
end
df_caverns.get_biome = function(pos)
local heat = minetest.get_heat(pos)
local humidity = minetest.get_humidity(pos)
for _, val in pairs(df_caverns.get_biome_at_pos_list) do
for _, val in pairs(get_biome_at_pos_list) do
local biome = val(pos, heat, humidity)
if biome ~= nil then
return biome

View File

@ -99,11 +99,13 @@ local hot_zone_boundary = 70
local middle_zone_boundary = 50
local cool_zone_boundary = 30
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.sunless_sea_min or pos.y >= df_caverns.config.level3_min then
return nil
end
if heat > hot_zone_boundary then
if pos.y < sea_level then
return "sunless undersea"
elseif heat > hot_zone_boundary then
return "barren" -- hot zone
elseif heat > middle_zone_boundary then
return "fungispore"

View File

@ -6,6 +6,7 @@ local modpath = minetest.get_modpath(modname)
local S = minetest.get_translator(modname)
local bones_loot_path = minetest.get_modpath("bones_loot")
local bones_node = df_dependencies.node_name_bones
local named_waypoints_path = minetest.get_modpath("named_waypoints")
local name_generator_path = minetest.get_modpath("name_generator")
@ -309,6 +310,8 @@ local get_pit = function(pos)
return {location = location, radius = radius, variance = variance, depth = depth}
end
df_caverns.get_nearest_glowing_pit = get_pit
local perlin_pit = {
offset = 0,
scale = 1,
@ -333,6 +336,13 @@ minetest.register_chatcommand("find_pit", {
end,
})
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y > y_max or pos.y < y_min then
return
end
return "underworld"
end)
minetest.register_on_generated(function(minp, maxp, seed)
--if out of range of cave definition limits, abort
@ -469,8 +479,32 @@ minetest.register_on_generated(function(minp, maxp, seed)
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
mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, lamppost_schematic)
local lamp_pos = vector.new(building.pos.x, building.pos.y+6, building.pos.z)
minetest.after(math.random()*10, function()
-- not all of these locations will get a lamp, but it's easier to just set four
-- timers than to worry about testing first.
minetest.get_node_timer({x=lamp_pos.x+1, y=lamp_pos.y, z=lamp_pos.z}):start(math.random()*30)
minetest.get_node_timer({x=lamp_pos.x-1, y=lamp_pos.y, z=lamp_pos.z}):start(math.random()*30)
minetest.get_node_timer({x=lamp_pos.x, y=lamp_pos.y, z=lamp_pos.z+1}):start(math.random()*30)
minetest.get_node_timer({x=lamp_pos.x, y=lamp_pos.y, z=lamp_pos.z-1}):start(math.random()*30)
end)
elseif building.building_type == "small building" then
mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, small_building_schematic, building.rotation)
local pos = building.pos
minetest.after(1, function()
local puzzle_chest = minetest.find_node_near(pos, 4, {"df_underworld_items:puzzle_chest_closed"}, true)
if puzzle_chest then
local def = minetest.registered_nodes["df_underworld_items:puzzle_chest_closed"]
def.can_dig(puzzle_chest) -- initializes the inventory
local meta = minetest.get_meta(puzzle_chest)
local inv = meta:get_inventory()
for i = 1, math.random(1,8) do
local item = ItemStack(df_underworld_items.colour_items[math.random(1,#df_underworld_items.colour_items)])
--item:set_count(math.random(1,4))
inv:add_item("main", item)
end
end
end)
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 name_generator_path then
@ -542,7 +576,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
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])
if math.random() < zone then -- bones are more common in the built-up areas
if math.random() < zone/2 then -- bones are more common in the built-up areas
local floor_node = minetest.get_node({x=x, y=floor_height, z=z})
local floor_node_def = minetest.registered_nodes[floor_node.name]
if floor_node_def and not floor_node_def.buildable_to then
@ -553,7 +587,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
if target_node.name == "air" then
bones_loot.place_bones(target_pos, "underworld_warrior", math.random(3, 10), nil, true)
break
elseif target_node.name == "bones:bones" then
elseif target_node.name == bones_node then
-- don't stack bones on bones, it looks silly
break
end