2014-06-20 15:12:46 +10:00
|
|
|
|
|
|
|
local CONFIG_FILE_PREFIX = "caverealms."
|
|
|
|
|
|
|
|
caverealms.config = {}
|
|
|
|
|
|
|
|
-- This function based on kaeza/minetest-irc/config.lua and used under the
|
|
|
|
-- terms of BSD 2-clause license.
|
|
|
|
local function setting(stype, name, default)
|
|
|
|
local value
|
|
|
|
if stype == "bool" then
|
|
|
|
value = minetest.setting_getbool(CONFIG_FILE_PREFIX..name)
|
|
|
|
elseif stype == "string" then
|
|
|
|
value = minetest.setting_get(CONFIG_FILE_PREFIX..name)
|
|
|
|
elseif stype == "number" then
|
|
|
|
value = tonumber(minetest.setting_get(CONFIG_FILE_PREFIX..name))
|
|
|
|
end
|
|
|
|
if value == nil then
|
|
|
|
value = default
|
|
|
|
end
|
|
|
|
caverealms.config[name] = value
|
|
|
|
end
|
|
|
|
|
2014-06-28 13:01:39 -10:00
|
|
|
--generation settings
|
|
|
|
setting("number", "ymin", -33000) --bottom realm limit
|
2017-02-16 22:35:47 +10:00
|
|
|
setting("number", "ymax", -1500) --top realm limit
|
2017-02-11 15:03:57 +10:00
|
|
|
setting("number", "tcave", 0.75) --cave threshold
|
2014-06-28 13:01:39 -10:00
|
|
|
|
|
|
|
--decoration chances
|
2017-02-11 15:03:57 +10:00
|
|
|
setting("number", "stagcha", 0.003) --chance of stalagmites
|
2014-06-28 13:01:39 -10:00
|
|
|
setting("number", "stalcha", 0.003) --chance of stalactites
|
2017-02-11 15:03:57 +10:00
|
|
|
|
|
|
|
setting("number", "h_lag", 8) --max height for stalagmites
|
|
|
|
setting("number", "h_lac", 8) --...stalactites
|
|
|
|
setting("number", "crystal", 0.0002) --chance of glow crystal formations
|
|
|
|
setting("number", "h_cry", 8) --max height of glow crystals
|
|
|
|
setting("number", "h_clac", 8) --max height of glow crystal stalactites
|
|
|
|
|
2014-06-28 13:01:39 -10:00
|
|
|
setting("number", "gemcha", 0.03) --chance of small glow gems
|
|
|
|
setting("number", "mushcha", 0.04) --chance of mushrooms
|
|
|
|
setting("number", "myccha", 0.03) --chance of mycena mushrooms
|
2017-02-11 18:59:03 +10:00
|
|
|
setting("number", "wormcha", 0.015) --chance of glow worms
|
2014-06-28 13:01:39 -10:00
|
|
|
setting("number", "giantcha", 0.001) --chance of giant mushrooms
|
|
|
|
setting("number", "icicha", 0.035) --chance of icicles
|
2014-08-06 14:37:35 -10:00
|
|
|
setting("number", "flacha", 0.04) --chance of constant flames
|
|
|
|
|
|
|
|
--realm limits for Dungeon Masters' Lair
|
2017-02-16 22:35:47 +10:00
|
|
|
setting("number", "dm_top", -14000) --upper limit
|
|
|
|
setting("number", "dm_bot", -16000) --lower limit
|
2017-02-19 03:59:48 +00:00
|
|
|
|
2017-02-25 14:34:21 +00:00
|
|
|
--should DMs spawn in DM Lair?
|
|
|
|
setting("bool", "dm_spawn", true)
|
|
|
|
|
2014-12-16 19:57:25 -10:00
|
|
|
--Deep cave settings
|
|
|
|
setting("number", "deep_cave", -7000) -- upper limit
|
2014-08-06 14:37:35 -10:00
|
|
|
|