config.lua 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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", -27000) --bottom realm limit (was -30000)
  21. setting("number", "ymax", -1500) --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.0002) --chance of glow crystal formations
  29. setting("number", "h_cry", 8) --max height of glow crystals
  30. setting("number", "h_clac", 8) --max height of glow crystal stalactites
  31. setting("number", "gemcha", 0.03) --chance of small glow gems
  32. setting("number", "mushcha", 0.04) --chance of mushrooms
  33. setting("number", "myccha", 0.03) --chance of mycena mushrooms
  34. setting("number", "wormcha", 0.015) --chance of glow worms
  35. setting("number", "giantcha", 0.001) --chance of giant mushrooms
  36. setting("number", "icicha", 0.035) --chance of icicles
  37. setting("number", "flacha", 0.04) --chance of constant flames
  38. --realm limits for Dungeon Masters' Lair
  39. setting("number", "dm_top", -14000) --upper limit
  40. setting("number", "dm_bot", -16000) --lower limit
  41. --should DMs spawn in DM Lair?
  42. setting("bool", "dm_spawn", true)
  43. --Deep cave settings
  44. setting("number", "deep_cave", -7000) -- upper limit