diff --git a/deco_plants.lua b/deco_plants.lua index 9784d41..17f7c60 100644 --- a/deco_plants.lua +++ b/deco_plants.lua @@ -41,6 +41,14 @@ fun_caves.plantlist = { sounds = default.node_sound_stone_defaults(), }, + {name="precious_coral", + desc="Precious Coral", + water=true, + light_source=1, + coral=true, + sounds = default.node_sound_stone_defaults(), + }, + {name="water_plant_1", desc="Water Plant", water=true, diff --git a/decogen.lua b/decogen.lua index e95e472..998cd95 100644 --- a/decogen.lua +++ b/decogen.lua @@ -23,6 +23,7 @@ local log = math.log local floor = math.floor local find_nodes_in_area = minetest.find_nodes_in_area local csize +local node_match_cache = {} local function place_schematic(minp, maxp, data, p2data, area, node, pos, schem, center) @@ -356,13 +357,11 @@ fun_caves.decogen = function(minp, maxp, data, p2data, area, node, heightmap, bi ----------------------------------------------------- -- end of cave decoration non-loop ----------------------------------------------------- - elseif y < height then + elseif y < height and data[ivm] == node["air"] and (data[ivm - area.ystride] == node['default:stone'] or data[ivm - area.ystride] == node['default:sandstone']) then -- This just places non-abm dirt inside caves. -- Its value is questionable. - if data[ivm] == node["air"] and (data[ivm - area.ystride] == node['default:stone'] or data[ivm - area.ystride] == node['default:sandstone']) then data[ivm - area.ystride] = node["fun_caves:dirt"] write = true - end else local pn = plant_n[index] local biome @@ -382,7 +381,11 @@ fun_caves.decogen = function(minp, maxp, data, p2data, area, node, heightmap, bi local node_above = data[ivm + area.ystride] if y < water_level and data[ivm] == node["default:sand"] and node_above == node["default:water_source"] and data[ivm + area.ystride * 2] == node["default:water_source"] and coral_biomes[biome] and pn < -0.1 and rand(5) == 1 and surround(node, data, area, ivm) then - data[ivm] = node["fun_caves:staghorn_coral_water_sand"] + if rand(100) == 1 then + data[ivm] = node["fun_caves:precious_coral_water_sand"] + else + data[ivm] = node["fun_caves:staghorn_coral_water_sand"] + end write = true break elseif y < water_level and node_below == node["default:sand"] and node_above == node["default:water_source"] and data[ivm] == node["default:water_source"] and coral_biomes[biome] and pn < -0.1 and rand(5) < 3 then diff --git a/mapgen.lua b/mapgen.lua index 0efba13..fc9289a 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -19,7 +19,6 @@ local node = setmetatable({}, { local data = {} local p2data = {} -- vm rotation data buffer -local node_match_cache = {} -- Create a table of biome ids, so I can use the biomemap. diff --git a/nodes.lua b/nodes.lua index bae3436..0796aa7 100644 --- a/nodes.lua +++ b/nodes.lua @@ -142,7 +142,9 @@ local function teleporter(user, area, power) else local newpos if area == 'overworld' then - newpos = {x=math.random(12000)-6000, y=120, z=math.random(12000)-6000} + newpos = {x=(math.random(2)*2-3)*(math.random(math.floor(map_max/6))+power*math.floor(map_max/6)), y=120, z=(math.random(2)*2-3)*(math.random(math.floor(map_max/6))+power*math.floor(map_max/6))} + elseif area == 'hell' then + newpos = {x=pos.x, y=fun_caves.underzones[({'Caina','Phlegethos','Dis','Minauros','Styx'})[power+1]].ceiling-30, z=pos.z} else return end @@ -159,6 +161,45 @@ local function teleporter(user, area, power) end end +minetest.register_craftitem("fun_caves:teleporter_iron_coral", { + description = "Iron and Moonstone Teleporter", + drawtype = "plantlike", + paramtype = "light", + tiles = {"fun_caves_tesseract_iron_coral.png"}, + inventory_image = "fun_caves_tesseract_iron_coral.png", + groups = {dig_immediate = 3}, + sounds = default.node_sound_stone_defaults(), + on_use = function(itemstack, user, pointed_thing) + teleporter(user, 'hell', 0) + end, +}) + +minetest.register_craft({ + output = 'fun_caves:teleporter_iron_coral', + recipe = { + {'fun_caves:sky_iron', 'default:copper_ingot', 'fun_caves:sky_iron'}, + {'fun_caves:coral_gem', 'fun_caves:coral_gem', 'fun_caves:coral_gem'}, + {'fun_caves:sky_iron', 'default:obsidian_shard', 'fun_caves:sky_iron'}, + } +}) + +minetest.register_craftitem("fun_caves:coral_gem", { + description = "Coral Gem", + drawtype = "plantlike", + paramtype = "light", + tiles = {"fun_caves_coral_gem.png"}, + inventory_image = "fun_caves_coral_gem.png", + groups = {dig_immediate = 3}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_craft({ + type = "cooking", + output = "fun_caves:coral_gem", + recipe = "fun_caves:precious_coral", + cooktime = 5, +}) + minetest.register_craftitem("fun_caves:teleporter_iron_aquamarine", { description = "Iron and Aquamarine Teleporter", drawtype = "plantlike", @@ -168,7 +209,7 @@ minetest.register_craftitem("fun_caves:teleporter_iron_aquamarine", { groups = {dig_immediate = 3}, sounds = default.node_sound_stone_defaults(), on_use = function(itemstack, user, pointed_thing) - teleporter(user, 'overworld', 1) + teleporter(user, 'overworld', 0) end, }) @@ -264,7 +305,7 @@ minetest.register_ore({ ore_type = "scatter", ore = "fun_caves:stone_with_aquamarines", wherein = "default:stone", - clust_scarcity = 30 * 30 * 30, + clust_scarcity = 17 * 17 * 17, clust_num_ores = 1, clust_size = 1, y_min = -6000, diff --git a/textures/fun_caves_coral_gem.png b/textures/fun_caves_coral_gem.png new file mode 100644 index 0000000..9b6c9f1 Binary files /dev/null and b/textures/fun_caves_coral_gem.png differ diff --git a/textures/fun_caves_precious_coral.png b/textures/fun_caves_precious_coral.png new file mode 100644 index 0000000..16caec3 Binary files /dev/null and b/textures/fun_caves_precious_coral.png differ diff --git a/textures/fun_caves_tesseract_iron_coral.png b/textures/fun_caves_tesseract_iron_coral.png new file mode 100644 index 0000000..2e085c3 Binary files /dev/null and b/textures/fun_caves_tesseract_iron_coral.png differ