Fix regression in coral. Add coral teleporter.

This commit is contained in:
Duane 2016-06-10 12:22:24 -05:00
parent 43176144f9
commit 9fedc6c52a
7 changed files with 59 additions and 8 deletions

View file

@ -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,

View file

@ -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
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

View file

@ -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.

View file

@ -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,

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB