config.lua 2.46 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

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

23
--generation settings
Milan's avatar
Milan committed
24 25
setting("number", "ymin", -28000) --bottom realm limit
setting("number", "ymax", -17000) --top realm limit
Chris N's avatar
Chris N committed
26
setting("number", "tcave", 0.5) --cave threshold
27

Chris N's avatar
Chris N committed
28 29 30
--should player spawn in caves?
setting("bool", "cavespawn", false)

31
--falling icicles
Milan's avatar
Milan committed
32
setting("bool", "falling_icicles", false) --enable/disable falling icicles
33 34 35 36 37 38 39 40 41 42 43 44 45
setting("number", "fallcha", 0.33) --chance of icicles falling when dug

--decoration chances
setting("number", "stagcha", 0.002) --chance of stalagmites
setting("number", "stalcha", 0.003) --chance of stalactites
setting("number", "h_lag", 15) --max height for stalagmites
setting("number", "h_lac", 20) --...stalactites
setting("number", "crystal", 0.007) --chance of glow crystal formations
setting("number", "h_cry", 9) --max height of glow crystals
setting("number", "h_clac", 13) --max height of glow crystal stalactites
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
Chris N's avatar
Chris N committed
46
setting("number", "wormcha", 0.02) --chance of glow worms
47 48
setting("number", "giantcha", 0.001) --chance of giant mushrooms
setting("number", "icicha", 0.035) --chance of icicles
49 50 51 52 53
setting("number", "flacha", 0.04) --chance of constant flames
setting("number", "founcha", 0.001) --chance of fountains
setting("number", "fortcha", 0.0003) --chance of fortresses

--realm limits for Dungeon Masters' Lair
Milan's avatar
Milan committed
54 55
setting("number", "dm_top", -24000) --upper limit 
setting("number", "dm_bot", -26000) --lower limit 
Chris N's avatar
Chris N committed
56 57 58
--should fortresses and fountains spawn?
setting("bool", "fortresses", true)
setting("bool", "fountains", true)
Chris N's avatar
Chris N committed
59
--Deep cave settings
Milan's avatar
Milan committed
60
setting("number", "deep_cave", -27800) -- upper limit
61 62 63 64

--minimum number of items in chests found in fortresses
setting("number", "min_items", 2)
--maximum number of items in chests found in fortresses
Milan's avatar
Milan committed
65
setting("number", "max_items", 5)