config.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. local CONFIG_FILE_PREFIX = "caverealms."
  2. caverealms.config = {}
  3. -- This function based on kaeza/minetest-irc/config.lua and used under the
  4. -- terms of BSD 2-clause license.
  5. local function setting(stype, name, default)
  6. local value
  7. if stype == "bool" then
  8. value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name)
  9. elseif stype == "string" then
  10. value = minetest.settings:get(CONFIG_FILE_PREFIX..name)
  11. elseif stype == "number" then
  12. value = tonumber(minetest.settings:get(CONFIG_FILE_PREFIX..name))
  13. end
  14. if value == nil then
  15. value = default
  16. end
  17. caverealms.config[name] = value
  18. end
  19. --generation settings
  20. setting("number", "ymin", -33000) --bottom realm limit
  21. setting("number", "ymax", -50) --top realm limit
  22. setting("number", "tcave", 0.75) --cave threshold
  23. --decoration chances
  24. setting("number", "stagcha", 0.003) --chance of stalagmites
  25. setting("number", "stalcha", 0.003) --chance of stalactites
  26. setting("number", "h_lag", 8) --max height for stalagmites
  27. setting("number", "h_lac", 8) --...stalactites
  28. setting("number", "crystal", 0.0004) --chance of glow crystal formations
  29. setting("number", "salt_crystal", 0.007) --chance of glow crystal formations
  30. setting("number", "h_cry", 8) --max height of glow crystals
  31. setting("number", "h_clac", 8) --max height of glow crystal stalactites
  32. setting("number", "gemcha", 0.03) --chance of small glow gems
  33. setting("number", "mushcha", 0.04) --chance of mushrooms
  34. setting("number", "myccha", 0.03) --chance of mycena mushrooms
  35. setting("number", "wormcha", 0.015) --chance of glow worms
  36. setting("number", "giantcha", 0.001) --chance of giant mushrooms
  37. setting("number", "icicha", 0.035) --chance of icicles
  38. setting("number", "flacha", 0.04) --chance of constant flames
  39. --realm limits for Dungeon Masters' Lair
  40. setting("number", "dm_top", -14000) --upper limit
  41. setting("number", "dm_bot", -16000) --lower limit
  42. --should DMs spawn in DM Lair?
  43. setting("bool", "dm_spawn", true)
  44. --Deep cave settings
  45. setting("number", "deep_cave", -7000) -- upper limit