Pseudo-merge pull request #3 from Zeno-/master
Manual merge of Zeno-'s changes, with several revisions.
This commit is contained in:
parent
b6d45be712
commit
6d6186af91
238
functions.lua
238
functions.lua
@ -85,7 +85,7 @@ function caverealms:crystal_stalagmite(x,y,z, area, data, biome)
|
||||
local c_meseore = minetest.get_content_id("default:stone_with_mese")
|
||||
local c_ice = minetest.get_content_id("default:ice")
|
||||
local c_thinice = minetest.get_content_id("caverealms:thin_ice")
|
||||
|
||||
|
||||
--for randomness
|
||||
local mode = 1
|
||||
if math.random(15) == 1 then
|
||||
@ -104,105 +104,56 @@ function caverealms:crystal_stalagmite(x,y,z, area, data, biome)
|
||||
end
|
||||
end
|
||||
|
||||
local stalids = {
|
||||
{ {c_crystore, c_crystal}, {c_emore, c_emerald} },
|
||||
{ {c_emore, c_emerald}, {c_crystore, c_crystal} },
|
||||
{ {c_emore, c_emerald}, {c_meseore, c_mesecry} },
|
||||
{ {c_ice, c_thinice}, {c_crystore, c_crystal}}
|
||||
}
|
||||
|
||||
local nid_a
|
||||
local nid_b
|
||||
local nid_s = c_stone --stone base, will be rewritten to ice in certain biomes
|
||||
|
||||
if biome > 3 then
|
||||
if mode == 1 then
|
||||
nid_a = c_ice
|
||||
nid_b = c_thinice
|
||||
nid_s = c_ice
|
||||
else
|
||||
nid_a = c_crystore
|
||||
nid_b = c_crystal
|
||||
end
|
||||
elseif mode == 1 then
|
||||
nid_a = stalids[biome][1][1]
|
||||
nid_b = stalids[biome][1][2]
|
||||
else
|
||||
nid_a = stalids[biome][2][1]
|
||||
nid_b = stalids[biome][2][2]
|
||||
end
|
||||
|
||||
local top = math.random(5,H_CRY) --grab a random height for the stalagmite
|
||||
for j = 0, top do --y
|
||||
for k = -3, 3 do
|
||||
for l = -3, 3 do
|
||||
if j == 0 then
|
||||
if k*k + l*l <= 9 then
|
||||
if (biome == 4 or biome == 5) and mode == 1 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = c_ice
|
||||
else
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = c_stone
|
||||
end
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = nid_s
|
||||
end
|
||||
elseif j <= top/5 then
|
||||
if k*k + l*l <= 4 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
if biome == 1 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_emore
|
||||
else
|
||||
data[vi] = c_crystore
|
||||
end
|
||||
elseif biome == 2 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_crystore
|
||||
else
|
||||
data[vi] = c_emore
|
||||
end
|
||||
elseif biome == 3 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_meseore
|
||||
else
|
||||
data[vi] = c_emore
|
||||
end
|
||||
elseif biome == 4 or biome == 5 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_crystore
|
||||
else
|
||||
data[vi] = c_ice
|
||||
end
|
||||
end
|
||||
data[vi] = nid_a
|
||||
end
|
||||
elseif j <= top/5 * 3 then
|
||||
if k*k + l*l <= 1 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
if biome == 1 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_emerald
|
||||
else
|
||||
data[vi] = c_crystal
|
||||
end
|
||||
elseif biome == 2 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_crystal
|
||||
else
|
||||
data[vi] = c_emerald
|
||||
end
|
||||
elseif biome == 3 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_mesecry
|
||||
else
|
||||
data[vi] = c_emerald
|
||||
end
|
||||
elseif biome == 4 or biome == 5 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_crystal
|
||||
else
|
||||
data[vi] = c_thinice
|
||||
end
|
||||
end
|
||||
data[vi] = nid_b
|
||||
end
|
||||
else
|
||||
local vi = area:index(x, y+j, z-3)
|
||||
if biome == 1 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_emerald
|
||||
else
|
||||
data[vi] = c_crystal
|
||||
end
|
||||
elseif biome == 2 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_crystal
|
||||
else
|
||||
data[vi] = c_emerald
|
||||
end
|
||||
elseif biome == 3 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_mesecry
|
||||
else
|
||||
data[vi] = c_emerald
|
||||
end
|
||||
elseif biome == 4 or biome == 5 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_crystal
|
||||
else
|
||||
data[vi] = c_thinice
|
||||
end
|
||||
end
|
||||
data[vi] = nid_b
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -220,8 +171,8 @@ function caverealms:crystal_stalactite(x,y,z, area, data, biome)
|
||||
local c_mesecry = minetest.get_content_id("caverealms:glow_mese")
|
||||
local c_meseore = minetest.get_content_id("default:stone_with_mese")
|
||||
local c_ice = minetest.get_content_id("default:ice")
|
||||
local c_thinice = minetest.get_content_id("caverealms:hanging_thin_ice")
|
||||
|
||||
local c_thinice = minetest.get_content_id("caverealms:hanging_thin_ice")
|
||||
|
||||
--for randomness
|
||||
local mode = 1
|
||||
if math.random(15) == 1 then
|
||||
@ -240,105 +191,56 @@ function caverealms:crystal_stalactite(x,y,z, area, data, biome)
|
||||
end
|
||||
end
|
||||
|
||||
local stalids = {
|
||||
{ {c_crystore, c_crystal}, {c_emore, c_emerald} },
|
||||
{ {c_emore, c_emerald}, {c_crystore, c_crystal} },
|
||||
{ {c_emore, c_emerald}, {c_meseore, c_mesecry} },
|
||||
{ {c_ice, c_thinice}, {c_crystore, c_crystal}}
|
||||
}
|
||||
|
||||
local nid_a
|
||||
local nid_b
|
||||
local nid_s = c_stone --stone base, will be rewritten to ice in certain biomes
|
||||
|
||||
if biome > 3 then
|
||||
if mode == 1 then
|
||||
nid_a = c_ice
|
||||
nid_b = c_thinice
|
||||
nid_s = c_ice
|
||||
else
|
||||
nid_a = c_crystore
|
||||
nid_b = c_crystal
|
||||
end
|
||||
elseif mode == 1 then
|
||||
nid_a = stalids[biome][1][1]
|
||||
nid_b = stalids[biome][1][2]
|
||||
else
|
||||
nid_a = stalids[biome][2][1]
|
||||
nid_b = stalids[biome][2][2]
|
||||
end
|
||||
|
||||
local bot = math.random(-H_CLAC, -6) --grab a random height for the stalagmite
|
||||
for j = bot, 0 do --y
|
||||
for k = -3, 3 do
|
||||
for l = -3, 3 do
|
||||
if j >= -1 then
|
||||
if k*k + l*l <= 9 then
|
||||
if (biome == 4 or biome == 5) and mode == 1 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = c_ice
|
||||
else
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = c_stone
|
||||
end
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = nid_s
|
||||
end
|
||||
elseif j >= bot/5 then
|
||||
if k*k + l*l <= 4 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
if biome == 1 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_emore
|
||||
else
|
||||
data[vi] = c_crystore
|
||||
end
|
||||
elseif biome == 2 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_crystore
|
||||
else
|
||||
data[vi] = c_emore
|
||||
end
|
||||
elseif biome == 3 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_meseore
|
||||
else
|
||||
data[vi] = c_emore
|
||||
end
|
||||
elseif biome == 4 or biome == 5 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_crystore
|
||||
else
|
||||
data[vi] = c_ice
|
||||
end
|
||||
end
|
||||
data[vi] = nid_a
|
||||
end
|
||||
elseif j >= bot/5 * 3 then
|
||||
if k*k + l*l <= 1 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
if biome == 1 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_emerald
|
||||
else
|
||||
data[vi] = c_crystal
|
||||
end
|
||||
elseif biome == 2 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_crystal
|
||||
else
|
||||
data[vi] = c_emerald
|
||||
end
|
||||
elseif biome == 3 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_mesecry
|
||||
else
|
||||
data[vi] = c_emerald
|
||||
end
|
||||
elseif biome == 4 or biome == 5 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_crystal
|
||||
else
|
||||
data[vi] = c_thinice
|
||||
end
|
||||
end
|
||||
data[vi] = nid_b
|
||||
end
|
||||
else
|
||||
local vi = area:index(x, y+j, z-3)
|
||||
if biome == 1 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_emerald
|
||||
else
|
||||
data[vi] = c_crystal
|
||||
end
|
||||
elseif biome == 2 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_crystal
|
||||
else
|
||||
data[vi] = c_emerald
|
||||
end
|
||||
elseif biome == 3 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_mesecry
|
||||
else
|
||||
data[vi] = c_emerald
|
||||
end
|
||||
elseif biome == 4 or biome == 5 then
|
||||
if mode == 2 then
|
||||
data[vi] = c_crystal
|
||||
else
|
||||
data[vi] = c_thinice
|
||||
end
|
||||
end
|
||||
data[vi] = nid_b
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -351,7 +253,7 @@ function caverealms:giant_shroom(x, y, z, area, data)
|
||||
local c_stem = minetest.get_content_id("caverealms:mushroom_stem")
|
||||
local c_cap = minetest.get_content_id("caverealms:mushroom_cap")
|
||||
local c_gills = minetest.get_content_id("caverealms:mushroom_gills")
|
||||
|
||||
|
||||
z = z - 5
|
||||
--cap
|
||||
for k = -5, 5 do
|
||||
|
21
init.lua
21
init.lua
@ -44,9 +44,6 @@ local WORMCHA = caverealms.config.wormcha --0.03 --chance of glow worms
|
||||
local GIANTCHA = caverealms.config.giantcha --0.001 -- chance of giant mushrooms
|
||||
local ICICHA = caverealms.config.icicha --0.035 -- chance of icicles
|
||||
|
||||
local FALLING_ICICLES = caverealms.config.falling_icicles --true --toggle to turn on or off falling icicles in glaciated biome
|
||||
local FALLCHA = caverealms.config.fallcha --0.33 --chance of causing the structure to fall
|
||||
|
||||
|
||||
|
||||
-- 3D noise for caverns
|
||||
@ -134,15 +131,19 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
local c_ice = minetest.get_content_id("default:ice")
|
||||
local c_thinice = minetest.get_content_id("caverealms:thin_ice")
|
||||
local c_crystal = minetest.get_content_id("caverealms:glow_crystal")
|
||||
local c_gem = minetest.get_content_id("caverealms:glow_gem")
|
||||
local c_gem1 = minetest.get_content_id("caverealms:glow_gem")
|
||||
local c_gem2 = minetest.get_content_id("caverealms:glow_gem_2")
|
||||
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_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_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")
|
||||
local c_worm = minetest.get_content_id("caverealms:glow_worm")
|
||||
local c_iciu = minetest.get_content_id("caverealms:icicle_up")
|
||||
local c_icid = minetest.get_content_id("caverealms:icicle_down")
|
||||
local c_icid = minetest.get_content_id("caverealms:icicle_down")
|
||||
|
||||
--some mandatory values
|
||||
local sidelen = x1 - x0 + 1 --usually equals 80 with default mapgen values. Always a multiple of 16.
|
||||
@ -250,8 +251,14 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
end
|
||||
--randomly place glow gems
|
||||
if math.random() < GEMCHA and biome == 1 then
|
||||
-- of random size
|
||||
local gems = { c_gem1, c_gem2, c_gem3, c_gem4, c_gem5 }
|
||||
local gidx = math.random(1, 12)
|
||||
if gidx > 5 then
|
||||
gidx = 1
|
||||
end
|
||||
local gi = area:index(x,y+1,z)
|
||||
data[gi] = c_gem
|
||||
data[gi] = gems[gidx]
|
||||
end
|
||||
if biome == 2 then --if fungus biome
|
||||
if math.random() < MUSHCHA then --mushrooms
|
||||
|
57
nodes.lua
57
nodes.lua
@ -2,6 +2,10 @@
|
||||
|
||||
--NODES--
|
||||
|
||||
local FALLING_ICICLES = caverealms.config.falling_icicles --true --toggle to turn on or off falling icicles in glaciated biome
|
||||
local FALLCHA = caverealms.config.fallcha --0.33 --chance of causing the structure to fall
|
||||
|
||||
|
||||
--glowing crystal
|
||||
minetest.register_node("caverealms:glow_crystal", {
|
||||
description = "Glow Crystal",
|
||||
@ -119,25 +123,37 @@ minetest.register_node("caverealms:hanging_thin_ice", {
|
||||
})
|
||||
|
||||
--glowing crystal gem
|
||||
minetest.register_node("caverealms:glow_gem", {
|
||||
description = "Glow Gem",
|
||||
tiles = {"caverealms_glow_gem.png"},
|
||||
inventory_image = "caverealms_glow_gem.png",
|
||||
wield_image = "caverealms_glow_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 = 1.0,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
},
|
||||
})
|
||||
local glow_gem_size = { 1.0, 1.2, 1.4, 1.6, 1.7 }
|
||||
|
||||
for i in ipairs(glow_gem_size) do
|
||||
if i == 1 then
|
||||
nodename = "caverealms:glow_gem"
|
||||
else
|
||||
nodename = "caverealms:glow_gem_"..i
|
||||
end
|
||||
|
||||
vs = glow_gem_size[i]
|
||||
|
||||
minetest.register_node(nodename, {
|
||||
description = "Glow Gem",
|
||||
tiles = {"caverealms_glow_gem.png"},
|
||||
inventory_image = "caverealms_glow_gem.png",
|
||||
wield_image = "caverealms_glow_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
|
||||
|
||||
--upward pointing icicle
|
||||
minetest.register_node("caverealms:icicle_up", {
|
||||
@ -303,4 +319,5 @@ minetest.register_node("caverealms:mushroom_gills", {
|
||||
is_ground_content = true,
|
||||
groups = {oddly_breakable_by_hand=1},
|
||||
drawtype = "plantlike",
|
||||
})
|
||||
paramtype = "light",
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user