config.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. local CONFIG_FILE_PREFIX = "radiant_damage_"
  2. radiant_damage.config = {}
  3. local print_settingtypes = false
  4. local function setting(stype, name, default, description)
  5. local value
  6. if stype == "bool" then
  7. value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name, default)
  8. elseif stype == "string" then
  9. value = minetest.settings:get(CONFIG_FILE_PREFIX..name)
  10. elseif stype == "int" or stype == "float" then
  11. value = tonumber(minetest.settings:get(CONFIG_FILE_PREFIX..name))
  12. end
  13. if value == nil then
  14. value = default
  15. end
  16. radiant_damage.config[name] = value
  17. if print_settingtypes then
  18. minetest.debug(CONFIG_FILE_PREFIX..name.." ("..description..") "..stype.." "..tostring(default))
  19. end
  20. end
  21. setting("bool", "enable_heat_damage", true, "Enable radiant lava damage")
  22. setting("int", "lava_damage", 2, "Damage dealt per second when standing directly adjacent to one lava node")
  23. setting("int", "fire_damage", .25, "Damage dealt per second when standing directly adjacent to one fire node")
  24. setting("bool", "enable_mese_damage", false, "Enable mese ore radiation damage")
  25. setting("int", "mese_interval", 5, "Number of seconds between mese radiation damage checks")
  26. setting("int", "mese_damage", 2, "Damage dealt per interval when standing directly adjacent to one mese ore node")