From 87ac0a670629e27cbdd0f8c5bb38a27b87037c76 Mon Sep 17 00:00:00 2001 From: Chris N Date: Thu, 7 Aug 2014 11:11:24 -1000 Subject: [PATCH] Add option to turn off fortresses Some people just can't stand the coolness. --- config.lua | 3 +++ init.lua | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config.lua b/config.lua index 5f1b630..2df6d0d 100644 --- a/config.lua +++ b/config.lua @@ -50,6 +50,9 @@ setting("number", "fortcha", 0.0003) --chance of fortresses --realm limits for Dungeon Masters' Lair setting("number", "dm_top", -4000) --upper limit setting("number", "dm_bot", -5000) --lower limit +--should fortresses and fountains spawn? +setting("bool", "fortresses", true) +setting("bool", "fountains", true) --minimum number of items in chests found in fortresses setting("number", "min_items", 2) diff --git a/init.lua b/init.lua index f213157..7852799 100644 --- a/init.lua +++ b/init.lua @@ -22,6 +22,9 @@ if caverealms.config.falling_icicles == true then print("[caverealms] falling icicles enabled.") end +local FORTRESSES = caverealms.config.fortresses --true | Should fortresses spawn? +local FOUNTAINS = caverealms.config.fountains --true | Should fountains spawn? + -- Parameters local YMIN = caverealms.config.ymin -- Approximate realm limits. @@ -284,10 +287,10 @@ minetest.register_on_generated(function(minp, maxp, seed) if math.random() < FLACHA then --neverending flames data[ai] = c_flame end - if math.random() < FOUNCHA then --DM FOUNTAIN + if math.random() < FOUNCHA and FOUNTAINS then --DM FOUNTAIN data[ai] = c_fountain end - if math.random() < FORTCHA then --DM FORTRESS + if math.random() < FORTCHA and FORTRESSES then --DM FORTRESS data[ai] = c_fortress end end