Commit b0fc5308 authored by Chris N's avatar Chris N

Version 0.8 - DeepRealms

Add the new DeepRealms, inspired by Zeno's fork, and add the new salt
crystal, obsidian, and coal dust biomes.
parent 3554b17e
......@@ -56,6 +56,8 @@ setting("number", "dm_bot", -5000) --lower limit
--should fortresses and fountains spawn?
setting("bool", "fortresses", true)
setting("bool", "fountains", true)
--Deep cave settings
setting("number", "deep_cave", -7000) -- upper limit
--minimum number of items in chests found in fortresses
setting("number", "min_items", 2)
......
......@@ -40,4 +40,14 @@ minetest.register_craft({
output = "default:water_source",
type = "shapeless",
recipe = {"caverealms:thin_ice"}
})
--use for coal dust
minetest.register_craft({
output = "default:coalblock",
recipe = {
{"caverealms:coal_dust","caverealms:coal_dust","caverealms:coal_dust"},
{"caverealms:coal_dust","caverealms:coal_dust","caverealms:coal_dust"},
{"caverealms:coal_dust","caverealms:coal_dust","caverealms:coal_dust"}
}
})
\ No newline at end of file
......@@ -119,6 +119,8 @@ function caverealms:crystal_stalagmite(x,y,z, area, data, biome)
local c_meseore = minetest.get_content_id("default:stone_with_mese")
local c_ruby = minetest.get_content_id("caverealms:glow_ruby")
local c_rubore = minetest.get_content_id("caverealms:glow_ruby_ore")
local c_ameth = minetest.get_content_id("caverealms:glow_amethyst")
local c_amethore = minetest.get_content_id("caverealms:glow_amethyst_ore")
local c_ice = minetest.get_content_id("default:ice")
local c_thinice = minetest.get_content_id("caverealms:thin_ice")
......@@ -147,6 +149,9 @@ function caverealms:crystal_stalagmite(x,y,z, area, data, biome)
{ {c_ice, c_thinice}, {c_crystore, c_crystal}},
{ {c_ice, c_thinice}, {c_crystore, c_crystal}},
{ {c_rubore, c_ruby}, {c_meseore, c_mesecry}},
{ {c_crystore, c_crystal}, {c_rubore, c_ruby} },
{ {c_rubore, c_ruby}, {c_emore, c_emerald}},
{ {c_amethore, c_ameth}, {c_meseore, c_mesecry} },
}
local nid_a
......@@ -215,6 +220,8 @@ function caverealms:crystal_stalactite(x,y,z, area, data, biome)
local c_meseore = minetest.get_content_id("default:stone_with_mese")
local c_ruby = minetest.get_content_id("caverealms:glow_ruby")
local c_rubore = minetest.get_content_id("caverealms:glow_ruby_ore")
local c_ameth = minetest.get_content_id("caverealms:glow_amethyst")
local c_amethore = minetest.get_content_id("caverealms:glow_amethyst_ore")
local c_ice = minetest.get_content_id("default:ice")
local c_thinice = minetest.get_content_id("caverealms:hanging_thin_ice")
......@@ -243,6 +250,9 @@ function caverealms:crystal_stalactite(x,y,z, area, data, biome)
{ {c_ice, c_thinice}, {c_crystore, c_crystal}},
{ {c_ice, c_thinice}, {c_crystore, c_crystal}},
{ {c_rubore, c_ruby}, {c_meseore, c_mesecry}},
{ {c_crystore, c_crystal}, {c_rubore, c_ruby} },
{ {c_rubore, c_ruby}, {c_emore, c_emerald}},
{ {c_amethore, c_ameth}, {c_meseore, c_mesecry} },
}
local nid_a
......@@ -294,6 +304,51 @@ function caverealms:crystal_stalactite(x,y,z, area, data, biome)
end
end
--glowing crystal stalagmite spawner
function caverealms:salt_stalagmite(x,y,z, area, data, biome)
if not caverealms:below_solid(x,y,z,area,data) then
return
end
--contest ids
local c_stone = minetest.get_content_id("default:stone")
local c_salt = minetest.get_content_id("caverealms:salt_crystal")
local scale = math.random(2, 4)
if scale == 2 then
for j = -3, 3 do
for k = -3, 3 do
local vi = area:index(x+j, y, z+k)
data[vi] = c_stone
if math.abs(j) ~= 3 and math.abs(k) ~= 3 then
local vi = area:index(x+j, y+1, z+k)
data[vi] = c_stone
end
end
end
else
for j = -4, 4 do
for k = -4, 4 do
local vi = area:index(x+j, y, z+k)
data[vi] = c_stone
if math.abs(j) ~= 4 and math.abs(k) ~= 4 then
local vi = area:index(x+j, y+1, z+k)
data[vi] = c_stone
end
end
end
end
for j = 2, scale + 2 do --y
for k = -2, scale - 2 do
for l = -2, scale - 2 do
local vi = area:index(x+k, y+j, z+l)
data[vi] = c_salt -- make cube
end
end
end
end
--function to create giant 'shrooms
function caverealms:giant_shroom(x, y, z, area, data)
......@@ -387,6 +442,7 @@ end
-- Experimental and very geometric function to create giant octagonal crystals in a variety of random directions
-- Uses calculations for points on a sphere, lines in geometric space
-- CURRENTLY USELESS, NOT LIKELY TO BE IMPLEMENTED SOON
function caverealms:giant_shroom(x, y, z, area, data)
--Grab content id's... diamond is a placeholder
local c_crys = minetest.get_content_id("default:diamondblock")
......
-- caverealms v.0.4 by HeroOfTheWinds
-- caverealms v.0.8 by HeroOfTheWinds
-- original cave code modified from paramat's subterrain
-- For Minetest 0.4.8 stable
-- Depends default
......@@ -47,6 +47,7 @@ local FORTCHA = caverealms.config.fortcha --0.0003 --chance of DM Fortresses
local DM_TOP = caverealms.config.dm_top -- -4000 --level at which Dungeon Master Realms start to appear
local DM_BOT = caverealms.config.dm_bot -- -5000 --level at which "" ends
local DEEP_CAVE = caverealms.config.deep_cave -- -7000 --level at which deep cave biomes take over
-- 3D noise for caves
......@@ -124,10 +125,26 @@ minetest.register_on_generated(function(minp, maxp, seed)
local c_gem3 = minetest.get_content_id("caverealms:glow_gem_3")
local c_gem4 = minetest.get_content_id("caverealms:glow_gem_4")
local c_gem5 = minetest.get_content_id("caverealms:glow_gem_5")
local c_saltgem1 = minetest.get_content_id("caverealms:salt_gem")
local c_saltgem2 = minetest.get_content_id("caverealms:salt_gem_2")
local c_saltgem3 = minetest.get_content_id("caverealms:salt_gem_3")
local c_saltgem4 = minetest.get_content_id("caverealms:salt_gem_4")
local c_saltgem5 = minetest.get_content_id("caverealms:salt_gem_5")
local c_spike1 = minetest.get_content_id("caverealms:spike")
local c_spike2 = minetest.get_content_id("caverealms:spike_2")
local c_spike3 = minetest.get_content_id("caverealms:spike_3")
local c_spike4 = minetest.get_content_id("caverealms:spike_4")
local c_spike5 = minetest.get_content_id("caverealms:spike_5")
local c_moss = minetest.get_content_id("caverealms:stone_with_moss")
local c_lichen = minetest.get_content_id("caverealms:stone_with_lichen")
local c_algae = minetest.get_content_id("caverealms:stone_with_algae")
local c_salt = minetest.get_content_id("caverealms:stone_with_salt")
local c_hcobble = minetest.get_content_id("caverealms:hot_cobble")
local c_gobsidian = minetest.get_content_id("caverealms:glow_obsidian")
local c_gobsidian2 = minetest.get_content_id("caverealms:glow_obsidian_2")
local c_coalblock = minetest.get_content_id("default:coalblock")
local c_desand = minetest.get_content_id("default:desert_sand")
local c_coaldust = minetest.get_content_id("caverealms:coal_dust")
local c_fungus = minetest.get_content_id("caverealms:fungus")
local c_mycena = minetest.get_content_id("caverealms:mycena")
local c_worm = minetest.get_content_id("caverealms:glow_worm")
......@@ -176,6 +193,12 @@ minetest.register_on_generated(function(minp, maxp, seed)
--decoration loop
for y = y0, y1 do -- for each x row progressing upwards
local is_deep = false
if y < DEEP_CAVE then
is_deep = true
end
local tcave --same as above
if y < yblmin then
tcave = TCAVE + ((yblmin - y) / BLEND) ^ 2
......@@ -193,8 +216,14 @@ minetest.register_on_generated(function(minp, maxp, seed)
--compare noise values to determine a biome
if n_biome >= 0 and n_biome < 0.5 then
biome = 1 --moss
if is_deep then
biome = 7 --salt crystal
end
elseif n_biome <= -0.5 then
biome = 2 --fungal
if is_deep then
biome = 8 --glow obsidian
end
elseif n_biome >= 0.5 then
if n_biome >= 0.7 then
biome = 5 --deep glaciated
......@@ -203,6 +232,9 @@ minetest.register_on_generated(function(minp, maxp, seed)
end
else
biome = 3 --algae
if is_deep then
biome = 9 --coal dust
end
end
if y <= DM_TOP and y >= DM_BOT then
......@@ -293,6 +325,58 @@ minetest.register_on_generated(function(minp, maxp, seed)
if math.random() < FORTCHA and FORTRESSES then --DM FORTRESS
data[ai] = c_fortress
end
elseif biome == 7 then
local bi = area:index(x,y-1,z)
data[vi] = c_salt
data[bi] = c_salt
if math.random() < GEMCHA then
-- gems of random size
local gems = { c_saltgem1, c_saltgem2, c_saltgem3, c_saltgem4, c_saltgem5 }
local gidx = math.random(1, 12)
if gidx > 5 then
gidx = 1
end
data[ai] = gems[gidx]
end
if math.random() < STAGCHA then
caverealms:salt_stalagmite(x,y,z, area, data)
end
elseif biome == 8 then
local bi = area:index(x,y-1,z)
if math.random() < 0.5 then
data[vi] = c_gobsidian
data[bi] = c_gobsidian
else
data[vi] = c_gobsidian2
data[bi] = c_gobsidian2
end
if math.random() < FLACHA then --neverending flames
data[ai] = c_flame
end
elseif biome == 9 then
local bi = area:index(x,y-1,z)
if math.random() < 0.05 then
data[vi] = c_coalblock
data[bi] = c_coalblock
elseif math.random() < 0.15 then
data[vi] = c_coaldust
data[bi] = c_coaldust
else
data[vi] = c_desand
data[bi] = c_desand
end
if math.random() < FLACHA * 0.75 then --neverending flames
data[ai] = c_flame
end
if math.random() < GEMCHA then
-- spikes of random size
local spikes = { c_spike1, c_spike2, c_spike3, c_spike4, c_spike5 }
local sidx = math.random(1, 12)
if sidx > 5 then
sidx = 1
end
data[ai] = spikes[sidx]
end
end
if math.random() < STAGCHA then
......
......@@ -62,6 +62,20 @@ minetest.register_node("caverealms:glow_ruby", {
sunlight_propagates = true,
})
--glowing amethyst
minetest.register_node("caverealms:glow_amethyst", {
description = "Glow Amethyst",
tiles = {"caverealms_glow_amethyst.png"},
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_glass_defaults(),
light_source = 13,
paramtype = "light",
use_texture_alpha = true,
drawtype = "glasslike",
sunlight_propagates = true,
})
--embedded crystal
minetest.register_node("caverealms:glow_ore", {
description = "Glow Crystal Ore",
......@@ -84,7 +98,7 @@ minetest.register_node("caverealms:glow_emerald_ore", {
paramtype = "light",
})
--embedded rub
--embedded ruby
minetest.register_node("caverealms:glow_ruby_ore", {
description = "Glow Ruby Ore",
tiles = {"caverealms_glow_ruby_ore.png"},
......@@ -95,6 +109,17 @@ minetest.register_node("caverealms:glow_ruby_ore", {
paramtype = "light",
})
--embedded amethyst
minetest.register_node("caverealms:glow_amethyst_ore", {
description = "Glow Amethyst Ore",
tiles = {"caverealms_glow_amethyst_ore.png"},
is_ground_content = true,
groups = {cracky=2},
sounds = default.node_sound_glass_defaults(),
light_source = 10,
paramtype = "light",
})
--thin (transparent) ice
minetest.register_node("caverealms:thin_ice", {
description = "Thin Ice",
......@@ -109,6 +134,20 @@ minetest.register_node("caverealms:thin_ice", {
paramtype = "light",
})
--salt crystal
minetest.register_node("caverealms:salt_crystal", {
description = "Salt Crystal",
tiles = {"caverealms_salt_crystal.png"},
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_glass_defaults(),
light_source = 11,
paramtype = "light",
use_texture_alpha = true,
drawtype = "glasslike",
sunlight_propagates = true,
})
--alternate version for stalactites
minetest.register_node("caverealms:hanging_thin_ice", {
description = "Thin Ice",
......@@ -182,6 +221,72 @@ for i in ipairs(glow_gem_size) do
})
end
--glowing salt gem
local salt_gem_size = { 1.0, 1.2, 1.4, 1.6, 1.7 }
for i in ipairs(salt_gem_size) do
if i == 1 then
nodename = "caverealms:salt_gem"
else
nodename = "caverealms:salt_gem_"..i
end
vs = salt_gem_size[i]
minetest.register_node(nodename, {
description = "Salt Gem",
tiles = {"caverealms_salt_gem.png"},
inventory_image = "caverealms_salt_gem.png",
wield_image = "caverealms_salt_gem.png",
is_ground_content = true,
groups = {cracky=3, oddly_breakable_by_hand=1},
sounds = default.node_sound_glass_defaults(),
light_source = 11,
paramtype = "light",
drawtype = "plantlike",
walkable = false,
buildable_to = true,
visual_scale = vs,
selection_box = {
type = "fixed",
fixed = {-0.5*vs, -0.5*vs, -0.5*vs, 0.5*vs, -5/16*vs, 0.5*vs},
}
})
end
--stone spike
local spike_size = { 1.0, 1.2, 1.4, 1.6, 1.7 }
for i in ipairs(spike_size) do
if i == 1 then
nodename = "caverealms:spike"
else
nodename = "caverealms:spike_"..i
end
vs = spike_size[i]
minetest.register_node(nodename, {
description = "Stone Spike",
tiles = {"caverealms_spike.png"},
inventory_image = "caverealms_spike.png",
wield_image = "caverealms_spike.png",
is_ground_content = true,
groups = {cracky=3, oddly_breakable_by_hand=1},
sounds = default.node_sound_stone_defaults(),
light_source = 3,
paramtype = "light",
drawtype = "plantlike",
walkable = false,
buildable_to = true,
visual_scale = vs,
selection_box = {
type = "fixed",
fixed = {-0.5*vs, -0.5*vs, -0.5*vs, 0.5*vs, -5/16*vs, 0.5*vs},
}
})
end
--upward pointing icicle
minetest.register_node("caverealms:icicle_up", {
description = "Icicle",
......@@ -260,6 +365,20 @@ minetest.register_node("caverealms:stone_with_algae", {
}),
})
--tiny-salt-crystal-covered cobble - pink-ish
minetest.register_node("caverealms:stone_with_salt", {
description = "Cave Stone with Salt",
tiles = {"caverealms_salty2.png"},--{"caverealms_salty2.png^caverealms_salty.png", "caverealms_salty2.png", "caverealms_salty2.png^caverealms_salty_side.png"},
light_source = 9,
paramtype = "light",
use_texture_alpha = true,
drawtype = "glasslike",
sunlight_propagates = true,
is_ground_content = true,
groups = {crumbly=3},
sounds = default.node_sound_glass_defaults(),
})
--Hot Cobble - cobble with lava instead of mortar XD
minetest.register_node("caverealms:hot_cobble", {
description = "Hot Cobble",
......@@ -273,6 +392,40 @@ minetest.register_node("caverealms:hot_cobble", {
}),
})
--Glow Obsidian
minetest.register_node("caverealms:glow_obsidian", {
description = "Glowing Obsidian",
tiles = {"caverealms_glow_obsidian.png"},
is_ground_content = true,
groups = {crumbly=1},
light_source = 7,
sounds = default.node_sound_stone_defaults({
footstep = {name="default_stone_footstep", gain=0.25},
}),
})
--Glow Obsidian 2 - has traces of lava
minetest.register_node("caverealms:glow_obsidian_2", {
description = "Hot Glow Obsidian",
tiles = {"caverealms_glow_obsidian2.png"},
is_ground_content = true,
groups = {crumbly=1, hot=1},
damage_per_second = 1,
light_source = 9,
sounds = default.node_sound_stone_defaults({
footstep = {name="default_stone_footstep", gain=0.25},
}),
})
--Coal Dust
minetest.register_node("caverealms:coal_dust", {
description = "Coal Dust",
tiles = {"caverealms_coal_dust.png"},
is_ground_content = true,
groups = {crumbly=3, falling_node=1, sand=1},
sounds = default.node_sound_sand_defaults(),
})
--glow worms
minetest.register_node("caverealms:glow_worm", {
description = "Glow Worms",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment