Place new ground covers. Also, had to change namegen's name to avoid a collision on ContentDB

This commit is contained in:
FaceDeer 2020-11-22 16:30:56 -07:00
parent dab827bf8f
commit fc2bc52203
10 changed files with 45 additions and 25 deletions

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, namegen, fireflies
optional_depends = df_farming, ice_sprites, oil, df_underworld_items, magma_conduits, bones_loot, named_waypoints, name_generator, fireflies

View File

@ -42,8 +42,11 @@ df_caverns.node_id.mese_crystal = minetest.get_content_id("df_mapitems:mese_crys
df_caverns.node_id.mese_crystal_block = minetest.get_content_id("df_mapitems:glow_mese")
df_caverns.node_id.pearls = minetest.get_content_id("df_mapitems:cave_pearls")
df_caverns.node_id.pebble_fungus = minetest.get_content_id("df_mapitems:dirt_with_pebble_fungus")
df_caverns.node_id.rock_rot = minetest.get_content_id("df_mapitems:rock_rot")
df_caverns.node_id.spongestone = minetest.get_content_id("df_mapitems:spongestone")
df_caverns.node_id.salt_crystal = minetest.get_content_id("df_mapitems:salt_crystal")
df_caverns.node_id.salty_cobble = minetest.get_content_id("df_mapitems:salty_cobble")
df_caverns.node_id.sand_scum = minetest.get_content_id("df_mapitems:sand_scum")
df_caverns.node_id.stillworm = minetest.get_content_id("df_mapitems:dirt_with_stillworm")
df_caverns.node_id.veinstone = minetest.get_content_id("df_mapitems:veinstone")
df_caverns.node_id.wet_flowstone = minetest.get_content_id("df_mapitems:wet_flowstone")

View File

@ -1,4 +1,5 @@
[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)
@ -17,6 +18,7 @@ dfcaverns_sunless_sea_threshold (Cavern threshold for sunless sea) float 0.4 0.0
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
@ -28,6 +30,7 @@ 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
@ -47,7 +50,6 @@ dfcaverns_underworld_hud_requires_item (Require an item to view waypoints) bool
#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
@ -61,6 +63,7 @@ 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
@ -70,4 +73,4 @@ dfcaverns_primordial_min (Lower limit of primordial caverns) int -4032
# 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
dcaverns_giant_mycelium_timer_spread (Giant Mycelium mapgen timer spread) int 10

View File

@ -13,6 +13,9 @@ local c_glowstone = df_caverns.node_id.glowstone
local c_ice = df_caverns.node_id.ice
local c_mossycobble = df_caverns.node_id.mossycobble
local c_oil = df_caverns.node_id.oil
local c_sand_scum = df_caverns.node_id.sand_scum
local c_spongestone = df_caverns.node_id.spongestone
local c_rock_rot = df_caverns.node_id.rock_rot
local c_water = df_caverns.node_id.water
local c_wet_flowstone = df_caverns.node_id.wet_flowstone
@ -64,7 +67,7 @@ df_caverns.flooded_cavern_floor = function(abs_cracks, vert_rand, vi, area, data
if abs_cracks < 0.25 then
data[vi] = c_mossycobble
elseif data[vi-ystride] ~= c_water then
data[vi] = c_dirt
data[vi] = c_sand_scum
end
-- put in only the large stalagmites that won't get in the way of the water
@ -95,8 +98,10 @@ df_caverns.wet_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, da
df_caverns.stalagmites(abs_cracks, vert_rand, vi, area, data, data_param2, true)
elseif abs_cracks < 0.6 then
data[vi] = c_cobble
elseif abs_cracks < 0.8 then
data[vi] = c_rock_rot
else
data[vi] = c_mossycobble
data[vi] = c_spongestone
if c_dead_fungus and math.random() < 0.05 then
data[vi+area.ystride] = c_dead_fungus
end

View File

@ -7,7 +7,7 @@ local S = minetest.get_translator(modname)
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_generator_path = minetest.get_modpath("name_generator")
local hunters_enabled = minetest.get_modpath("hunter_statue") and df_underworld_items.config.underworld_hunter_statues
@ -51,14 +51,14 @@ if named_waypoints_path then
end
named_waypoints.register_named_waypoints("puzzle_seals", seal_waypoint_def)
if namegen_path then
namegen.parse_lines(io.lines(modpath.."/underworld_names.cfg"))
if name_generator_path then
name_generator.parse_lines(io.lines(modpath.."/underworld_names.cfg"))
name_pit = function()
return namegen.generate("glowing_pits")
return name_generator.generate("glowing_pits")
end
name_ruin = function()
return namegen.generate("underworld_ruins")
return name_generator.generate("underworld_ruins")
end
local underworld_ruin_def = {
@ -467,7 +467,7 @@ 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 named_waypoints_path and name_generator_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

View File

@ -9,6 +9,10 @@ df_farming.node_names.dirt = "default:dirt"
df_farming.node_names.dirt_moss = "df_farming:dirt_with_cave_moss"
df_farming.node_names.floor_fungus = "df_farming:cobble_with_floor_fungus"
df_farming.node_names.dirt_wet = "farming:soil_wet"
df_farming.node_names.mortar_pestle = "farming:mortar_pestle"
df_farming.node_names.bucket = "bucket:bucket_empty"
df_farming.node_names.wool_white = "wool:white"
-- these are only for initialization
minetest.after(0, function()

View File

@ -97,7 +97,7 @@ minetest.register_craftitem("df_farming:pig_tail_thread", {
if minetest.get_modpath("wool") then
minetest.register_craft({
output = "wool:white",
output = df_farming.node_names.wool_white,
recipe = {
{"group:thread", "group:thread"},
{"group:thread", "group:thread"},

View File

@ -114,14 +114,14 @@ if minetest.get_modpath("cottages") then
recipe_registered = true
end
if minetest.registered_items["farming:mortar_pestle"] ~= nil then
if minetest.registered_items[df_farming.node_names.mortar_pestle] ~= nil then
minetest.register_craft({
type = "shapeless",
output = "df_farming:sugar",
recipe = {
"df_farming:sweet_pods", "farming:mortar_pestle"
"df_farming:sweet_pods", df_farming.node_names.mortar_pestle
},
replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}},
replacements = {{"group:food_mortar_pestle", df_farming.node_names.mortar_pestle}},
})
recipe_registered = true
end
@ -247,7 +247,7 @@ if minetest.get_modpath("bucket") then
if minetest.get_modpath("crafting") then
simplecrafting_lib.register("furnace", {
input = {
["bucket:bucket_empty"] = 1,
[df_farming.node_names.bucket] = 1,
["df_farming:sugar"] = 3,
["simplecrafting_lib:heat"] = 5,
},
@ -257,7 +257,7 @@ if minetest.get_modpath("bucket") then
minetest.register_craft({
type = "shapeless",
output = "df_farming:dwarven_syrup_bucket",
recipe = {"bucket:bucket_empty", "df_farming:sugar", "df_farming:sugar", "df_farming:sugar"},
recipe = {df_farming.node_names.bucket, "df_farming:sugar", "df_farming:sugar", "df_farming:sugar"},
})
end

View File

@ -33,6 +33,9 @@ df_mapitems.node_name.dirt = "default:dirt"
df_mapitems.node_name.stone = "default:stone"
df_mapitems.node_name.ice = "default:ice"
df_mapitems.node_name.farming_soil = "farming:soil"
df_mapitems.node_name.farming_soil_wet = "farming:soil_wet"
-- This stuff should only be used during initialization
minetest.after(0, function()
df_mapitems.node_name = nil

View File

@ -18,6 +18,8 @@ local function soil_type_spread(label, node_to_spread, target_node)
}
end
local farming_soil = df_mapitems.node_name.farming_soil
local farming_soil_wet = df_mapitems.node_name.farming_soil_wet
--------------------------------------------------
-- Cave moss
@ -47,8 +49,8 @@ minetest.register_node("df_mapitems:dirt_with_cave_moss", {
sounds = df_mapitems.sounds.dirt_mossy,
soil = {
base = "df_mapitems:dirt_with_cave_moss",
dry = "farming:soil",
wet = "farming:soil_wet"
dry = farming_soil,
wet = farming_soil_wet
},
_dfcaverns_dead_node = dirt_node,
})
@ -94,8 +96,8 @@ minetest.register_node("df_mapitems:dirt_with_pebble_fungus", {
sounds = df_mapitems.sounds.dirt,
soil = {
base = "df_mapitems:dirt_with_pebble_fungus",
dry = "farming:soil",
wet = "farming:soil_wet"
dry = farming_soil,
wet = farming_soil_wet
},
_dfcaverns_dead_node = dirt_node,
})
@ -120,8 +122,8 @@ minetest.register_node("df_mapitems:dirt_with_stillworm", {
sounds = df_mapitems.sounds.dirt_mossy,
soil = {
base = "df_mapitems:dirt_with_stillworm",
dry = "farming:soil",
wet = "farming:soil_wet"
dry = farming_soil,
wet = farming_soil_wet
},
_dfcaverns_dead_node = dirt_node,
})
@ -142,8 +144,8 @@ minetest.register_node("df_mapitems:spongestone", {
sounds = df_mapitems.sounds.dirt,
soil = {
base = "df_mapitems:spongestone",
dry = "farming:soil",
wet = "farming:soil_wet"
dry = farming_soil,
wet = farming_soil_wet
},
_dfcaverns_dead_node = dirt_node,
})