Compare commits

...

5 Commits

Author SHA1 Message Date
Nathan Salapat 188f98478c
Merge pull request #2 from oversword/spawn-config
Spawn config options added
2020-01-24 22:20:09 -06:00
Cam B 106ade57dd code style 2020-01-25 00:43:44 +00:00
Cam B 8c12363909 Spawn config options added 2020-01-25 00:42:03 +00:00
NathanSalapat d448fa3391 fixed error with mymonths check. 2017-01-01 14:39:10 -06:00
NathanSalapat f65aca7e29 forgot to change ABM from my testing. 2016-12-26 11:31:51 -06:00
7 changed files with 37 additions and 9 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
config.lua

View File

@ -74,8 +74,8 @@ minetest.register_decoration({
minetest.register_abm{
nodenames = {"group:dl_bc"},
interval = 1,
chance = 1,
interval = 40,
chance = 30,
action = function(pos)
local node = minetest.get_node(pos)
if node.name == 'desert_life:barrel_cacti_1_sp' then

24
config.lua Normal file
View File

@ -0,0 +1,24 @@
--[[ DEFAULTS: --
spawn_on = {"group:soil", "group:stone"},
spawn_near = {"air"},
spawn_min_light = 0,
spawn_max_light = 15,
spawn_interval = 30,
spawn_chance = 5000,
spawn_active_object_count = 1,
spawn_min_height = -31000,
spawn_max_height = 31000,
]]
local config = {}
config.spawn_enabled_ostrich = true
config.spawn_on_ostrich = {"default:desert_sand", "default:desert_stone"}
config.spawn_max_light_ostrich = 20
config.spawn_min_light_ostrich = 10
config.spawn_chance_ostrich = 1500
config.spawn_active_object_count_ostrich = 1
config.spawn_max_height_ostrich = 31000
global_desert_life = config

View File

@ -43,7 +43,6 @@ function desert_life.spread(nodename, pos, spread, undernode, replacing, needed_
local can_replace = minetest.find_nodes_in_area(pos0, pos1, replacing)
local replace_num = #can_replace
if replace_num >= needed_air then --increase to decrease number of plants.
print ('spreading plant because found '..replace_num..' of '..needed_air..' air.')
local face_ran = math.random(0,3)
minetest.set_node(location, {name = nodename, param2 = face_ran})
end

View File

@ -1,9 +1,12 @@
desert_life = {}
if minetest.get_modpath('mymonths') then
desert_life_bloom = true
desert_life.bloom = true
print 'mymonths is here, lets make things bloom.'
end
dofile(minetest.get_modpath('desert_life')..'/config.lua') -- Oversword
dofile(minetest.get_modpath('desert_life')..'/functions.lua')
dofile(minetest.get_modpath('desert_life')..'/prickly_pear.lua')
dofile(minetest.get_modpath('desert_life')..'/barrel_cacti.lua')

View File

@ -54,8 +54,8 @@ mobs:register_mob("desert_life:ostrich", {
replace_with = 'air',
replace_rate = 1,
})
mobs:register_spawn("desert_life:ostrich",
{"default:desert_sand", "default:desert_stone"}, 20, 10, 1500, 1, 31000, true)
if global_desert_life.spawn_enabled_ostrich then
mobs:register_spawn("desert_life:ostrich", global_desert_life.spawn_on_ostrich, global_desert_life.spawn_max_light_ostrich, global_desert_life.spawn_min_light_ostrich, global_desert_life.spawn_chance_ostrich, global_desert_life.spawn_active_object_count_ostrich, global_desert_life.spawn_max_height_ostrich, true)
end
mobs:register_egg("desert_life:ostrich", S("Ostrich"), "dl_ostrich_inv.png", 0)

View File

@ -74,7 +74,7 @@ for i in ipairs (prickly_pear_table) do
end
})
if desert_life_bloom == true then
if desert_life.bloom == true then
minetest.register_node('desert_life:prickly_pear_'..num..'_bloom', {
description = 'Blooming Prickly Pear',
drawtype = 'mesh',
@ -178,7 +178,8 @@ minetest.register_abm{
end,
}
if desert_life_bloom == true then
if desert_life.bloom == true then
print 'mymonths is enabled.'
minetest.register_abm{
nodenames = {"group:dl_pp"},
interval = 1,