Reorganize nodes.lua for clarity.

This commit is contained in:
Duane Robertson 2016-05-26 22:55:32 -05:00
parent f5ed9d1cb2
commit a117583db6
9 changed files with 707 additions and 683 deletions

View file

@ -1,4 +1,5 @@
-- search/replace -- lets mobs change the terrain
-- used for goblin traps and torch thieving
fun_caves.search_replace = function(pos, search_rate, replace_what, replace_with)
if math.random(1, search_rate) == 1 then
local p1 = vector.subtract(pos, 1)
@ -16,6 +17,7 @@ fun_caves.search_replace = function(pos, search_rate, replace_what, replace_with
end
end
-- causes mobs to take damage from hot/cold surfaces
fun_caves.surface_damage = function(self, cold_natured)
--if not self.fun_caves_damage_timer then
-- self.fun_caves_damage_timer = 0
@ -47,7 +49,8 @@ fun_caves.surface_damage = function(self, cold_natured)
--end
end
-- executed in a mob's do_custom() to regulate their actions
-- if false, do nothing
local custom_delay = 1000000
fun_caves.custom_ready = function(self)
local time = minetest.get_us_time()
@ -59,19 +62,20 @@ fun_caves.custom_ready = function(self)
end
end
local path = minetest.get_modpath(minetest.get_current_modname())
dofile(path .. "/danglers.lua")
dofile(path .. "/spider.lua")
dofile(path .. "/tarantula.lua")
dofile(path .. "/spider_ice.lua")
--dofile(path .. "/dirt_monster.lua")
dofile(path .. "/sand_monster.lua")
dofile(path .. "/tar_monster.lua")
dofile(fun_caves.path .. "/danglers.lua")
dofile(fun_caves.path .. "/spider.lua")
dofile(fun_caves.path .. "/tarantula.lua")
dofile(fun_caves.path .. "/spider_ice.lua")
--dofile(fun_caves.path .. "/dirt_monster.lua")
dofile(fun_caves.path .. "/sand_monster.lua")
dofile(fun_caves.path .. "/tar_monster.lua")
if minetest.registered_entities["mobs_monster:dirt_monster"] then
-- check this
mobs:register_spawn("mobs_monster:dirt_monster", {"default:dirt"}, 7, 0, 7000, 1, -50, false)
end
if minetest.registered_entities["mobs_slimes:green_big"] then
mobs:spawn_specific("mobs_slimes:green_big",
{"fun_caves:stone_with_moss", "fun_caves:stone_with_algae"},
@ -89,6 +93,7 @@ if minetest.registered_entities["mobs_slimes:green_big"] then
4, 20, 30, 30000, 3, -31000, 31000
)
end
if minetest.registered_entities["mobs_creeper:creeper"] then
mobs:spawn_specific("mobs_creeper:creeper",
{"fun_caves:stone_with_moss"},
@ -105,12 +110,12 @@ fun_caves.goblin_torch_freq = 2
fun_caves.goblin_drops = { "default:pick_steel", "default:sword_steel", "default:shovel_steel", "farming:bread", "bucket:bucket_water", "default:pick_stone", "default:sword_stone" }
--{"group:stone"} = { "default:stone", "default:mossycobble", "default:sandstone", "default:desert_stone", "default:stone_with_coal", "default:stone_with_iron", "default:stone_with_copper", "default:stone_with_gold", "default:stone_with_diamond" }
dofile(path.."/goblin_cobbler.lua")
dofile(path.."/goblin_digger.lua")
dofile(path.."/goblin_coal.lua")
dofile(path.."/goblin_ice.lua")
dofile(path.."/goblin_copper.lua")
dofile(path.."/goblin_iron.lua")
dofile(path.."/goblin_gold.lua")
dofile(path.."/goblin_diamond.lua")
dofile(path.."/goblin_king.lua")
dofile(fun_caves.path.."/goblin_cobbler.lua")
dofile(fun_caves.path.."/goblin_digger.lua")
dofile(fun_caves.path.."/goblin_coal.lua")
dofile(fun_caves.path.."/goblin_ice.lua")
dofile(fun_caves.path.."/goblin_copper.lua")
dofile(fun_caves.path.."/goblin_iron.lua")
dofile(fun_caves.path.."/goblin_gold.lua")
dofile(fun_caves.path.."/goblin_diamond.lua")
dofile(fun_caves.path.."/goblin_king.lua")