From 518a8384fc1768da0ee0aec15c3770d20a3d5c2e Mon Sep 17 00:00:00 2001 From: Duane Date: Tue, 5 Jul 2016 07:36:36 -0500 Subject: [PATCH] Add minerals to giant trees. Raise fortresses to -33 max. This could cause issues with really deep oceans, but I haven't seen any. --- mapgen.lua | 2 +- mobs.lua | 7 ++++--- treegen.lua | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/mapgen.lua b/mapgen.lua index 1475dac..0c1cf0d 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -1,4 +1,4 @@ -local fortress_depth = -3 -- close to y / 80 +local fortress_depth = -1 -- close to y / 80 local seed_noise = {offset = 0, scale = 32768, seed = 5202, spread = {x = 80, y = 80, z = 80}, octaves = 2, persist = 0.4, lacunarity = 2} diff --git a/mobs.lua b/mobs.lua index 291758b..ee91e1a 100644 --- a/mobs.lua +++ b/mobs.lua @@ -338,11 +338,12 @@ if minetest.registered_entities["mobs:bee"] then local pos = self.object:getpos() pos.y = pos.y + 1 + local odds = 25 if self.name == 'fun_caves:killer_bee' then - fun_caves.search_replace(pos, 5, {'group:tree', 'fun_caves:glowing_fungal_wood',}, 'air') - else - fun_caves.search_replace(pos, 25, {'group:tree', 'fun_caves:glowing_fungal_wood',}, 'air') + odds = 5 end + fun_caves.search_replace(pos, odds, {'fun_caves:tree', 'fun_caves:ironwood', 'fun_caves:diamondwood', 'fun_caves:glowing_fungal_wood',}, 'air') + fun_caves.search_replace(pos, 10, {"fun_caves:tree"}, "fun_caves:glowing_fungal_wood") fun_caves.search_replace(pos, 60, {"fun_caves:glowing_fungal_wood", 'fun_caves:sap'}, "air") diff --git a/treegen.lua b/treegen.lua index 756e525..d6445dc 100644 --- a/treegen.lua +++ b/treegen.lua @@ -15,6 +15,44 @@ newnode.tiles = {"fun_caves_tree.png"} newnode.is_ground_content = false minetest.register_node("fun_caves:tree", newnode) +newnode = fun_caves.clone_node("fun_caves:tree") +newnode.description = "Giant Wood With Mineral" +newnode.tiles = {"fun_caves_tree.png^fun_caves_mineral_aquamarine.png"} +-- This drop list is more complicated than it ought to be. +-- The lua documentation is inaccurate. +newnode.drop = { + max_items = 1, + items = { + { + items = { 'fun_caves:aquamarine', }, + rarity = 10, + }, + { + items = { 'fun_caves:moonstone', }, + rarity = 10, + }, + { + items = { 'fun_caves:garnet', }, + rarity = 10, + }, + { + items = { 'fun_caves:zoisite', }, + rarity = 10, + }, + { + items = { 'fun_caves:coral_gem', }, + rarity = 30, + }, + { + items = { + 'fun_caves:meteorite', + }, + rarity = 1, + }, + }, +} +minetest.register_node("fun_caves:tree_mineral", newnode) + minetest.register_craft({ output = 'default:wood 4', recipe = { @@ -268,8 +306,12 @@ fun_caves.treegen = function(minp, maxp, data, p2data, area, node) data[ivm] = node['fun_caves:diamondwood'] end - if data[ivm] ~= node['air'] and data[ivm] ~= node['fun_caves:weightless_water'] and math_random(500) == 1 then - data[ivm] = node['fun_caves:sap'] + if data[ivm] ~= node['air'] and data[ivm] ~= node['fun_caves:weightless_water'] then + if math_random(500) == 1 then + data[ivm] = node['fun_caves:sap'] + elseif math_random(1000) == 1 then + data[ivm] = node['fun_caves:tree_mineral'] + end end write = true elseif y < 222 and y > -132 and distance < r + 2 then