Allow to disable cobwebs and mob spawners

master
Wuzzy 2017-08-14 04:21:59 +02:00
parent 2e9ca06284
commit 1cfab35eab
2 changed files with 21 additions and 2 deletions

View File

@ -72,6 +72,20 @@ if setting then
probability_damage = P(setting)
end
-- Enable cobwebs
local place_cobwebs = true
setting = minetest.settings:get_bool("tsm_railcorridors_place_cobwebs")
if setting ~= nil then
place_cobwebs = setting
end
-- Enable mob spawners
local place_mob_spawners = true
setting = minetest.settings:get_bool("tsm_railcorridors_place_mob_spawners")
if setting ~= nil then
place_mob_spawners = setting
end
-- Max. and min. heights between rail corridors are generated
local height_min = -31000
local height_max = -30
@ -524,7 +538,8 @@ local function corridor_func(waypoint, coord, sign, up_or_down, up_or_down_next,
end
-- Mob spawner (at center)
if tsm_railcorridors.nodes.spawner and not corridor_has_spawner and webperlin_major:get3d(p) > 0.3 and webperlin_minor:get3d(p) > 0.5 then
if place_mob_spawners and tsm_railcorridors.nodes.spawner and not corridor_has_spawner and
webperlin_major:get3d(p) > 0.3 and webperlin_minor:get3d(p) > 0.5 then
-- Place spawner (if activated in gameconfig),
-- enclose in cobwebs and setup the spawner node.
local spawner_placed = SetNodeIfCanBuild(p, {name=tsm_railcorridors.nodes.spawner})
@ -545,7 +560,7 @@ local function corridor_func(waypoint, coord, sign, up_or_down, up_or_down_next,
end
-- Place cobwebs left and right in the corridor
if tsm_railcorridors.nodes.cobweb then
if place_cobwebs and tsm_railcorridors.nodes.cobweb then
-- Helper function to place a cobweb at the side (based on chance an Perlin noise)
local cobweb_at_side = function(basepos, vek)
if pr:next(1,5) == 1 then

View File

@ -20,6 +20,10 @@ tsm_railcorridors_probability_fork (Fork probability) float 0.04 0.0 1.0
#Probability (0.0 to 1.0) for every part of a rail corridor to contain a treasure chest.
tsm_railcorridors_probability_chest (Chest probability) float 0.05 0.0 1.0
#If enabled, cobwebs may be placed in some corridors.
#Currently, cobwebs are only supported with the Mobs Redo mod.
tsm_railcorridors_place_cobwebs (Cobwebs) bool true
#Probability (0.0 to 1.0) for a rail corridor system to have damaged/incomplete railways
tsm_railcorridors_probability_damage (Damaged railway probability) float 0.55 0.0 1.0