Use mobs redo api instead of replicating.

This commit is contained in:
Duane Robertson 2016-05-20 00:58:12 -05:00
parent 6f25d3c388
commit a46641fcac
22 changed files with 120 additions and 3326 deletions

View file

@ -16,18 +16,49 @@ fun_caves.search_replace = function(pos, search_rate, replace_what, replace_with
end
end
fun_caves.surface_damage = function(self, cold_natured)
if not self.fun_caves_damage_timer then
self.fun_caves_damage_timer = 0
end
self.fun_caves_damage_timer = self.fun_caves_damage_timer + 1
if self.fun_caves_damage_timer > 30 then
self.fun_caves_damage_timer = 0
local pos = self.object:getpos()
local minp = vector.subtract(pos, 1.5)
local maxp = vector.add(pos, 1.5)
local counts = 0
if self.lava_damage > 0 then
counts = minetest.find_nodes_in_area(minp, maxp, {"group:surface_hot"})
if #counts > 0 then
self.health = self.health - self.lava_damage
effect(pos, 5, "fire_basic_flame.png")
end
end
if not cold_natured then
counts = minetest.find_nodes_in_area(minp, maxp, {"group:surface_cold"})
if #counts > 0 then
self.health = self.health - 1
end
end
check_for_death(self)
end
end
dofile(fun_caves.path .. "/mobs_crafts.lua")
dofile(fun_caves.path .. "/danglers.lua")
dofile(fun_caves.path .. "/spider.lua")
dofile(fun_caves.path .. "/spider_ice.lua")
dofile(fun_caves.path .. "/dirt_monster.lua")
dofile(fun_caves.path .. "/stone_monster.lua")
dofile(fun_caves.path .. "/lava_flan.lua")
--dofile(fun_caves.path .. "/dungeon_master.lua")
--dofile(fun_caves.path .. "/mese_monster.lua")
--dofile(fun_caves.path .. "/dirt_monster.lua")
dofile(fun_caves.path .. "/sand_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
fun_caves.goblin_spawn_frequency = 150
fun_caves.goblin_drops = { "default:pick_steel", "default:sword_steel", "default:shovel_steel", "farming:bread", "bucket:bucket_water", "default:pick_stone", "default:sword_stone" }