From 859f84686ad9259bbd362246dc4d5c4144fe949c Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sun, 8 Dec 2019 01:19:35 -0700 Subject: [PATCH] fix ice/oil on level 3, tweak some loot probabilities --- df_caverns/dungeon_loot.lua | 24 ++++++++++++------------ df_caverns/level3.lua | 8 ++++---- df_caverns/shared.lua | 2 ++ 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/df_caverns/dungeon_loot.lua b/df_caverns/dungeon_loot.lua index cce2770..1dcbcdc 100644 --- a/df_caverns/dungeon_loot.lua +++ b/df_caverns/dungeon_loot.lua @@ -49,14 +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 = "flowers:dandelion_white", chance = 0.01, count = {1,1}, types = {"underworld_warrior"}}, - {name = "flowers:dandelion_yellow", chance = 0.01, count = {1,1}, types = {"underworld_warrior"}}, - {name = "flowers:rose", chance = 0.01, count = {1,1}, types = {"underworld_warrior"}}, - {name = "flowers:tulip", chance = 0.01, count = {1,1}, types = {"underworld_warrior"}}, - {name = "flowers:chrysanthemum_green", chance = 0.01, count = {1,1}, types = {"underworld_warrior"}}, - {name = "flowers:geranium", 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 @@ -76,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/level3.lua b/df_caverns/level3.lua index 6c6dd8d..22fcabe 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 @@ -208,7 +208,8 @@ 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, x, y, z in area:iterp_yxz(area.MinEdge, area.MaxEdge) do - if y <= subsea_level and nvals_cave[vi] < -flooding_threshold then + 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 @@ -218,8 +219,7 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) if biome_name == "blackcap" then -- oil slick - local cave = math.abs(nvals_cave[vi]) - if y == subsea_level and data[vi] == c_water and cave + nvals_cracks[index2d]*0.025 < cavern_def.cave_threshold + 0.1 then + 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 diff --git a/df_caverns/shared.lua b/df_caverns/shared.lua index 48ab793..52ce208 100644 --- a/df_caverns/shared.lua +++ b/df_caverns/shared.lua @@ -233,6 +233,8 @@ df_caverns.is_ground_content = function(c_node) 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 dfcaverns_mods = nil return not dfcaverns_nodes[c_node] end \ No newline at end of file