From 8d70e7a7cb0f0ddc6b9c86b9550843fa26848642 Mon Sep 17 00:00:00 2001 From: Duane Date: Tue, 5 Jul 2016 09:56:37 -0500 Subject: [PATCH] Add fun caves stones to stone spawning monsters. --- mobs.lua | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/mobs.lua b/mobs.lua index ee91e1a..25d2265 100644 --- a/mobs.lua +++ b/mobs.lua @@ -42,10 +42,10 @@ fun_caves.surface_damage = function(self, cold_natured) local minp = vector.subtract(pos, 1.5) local maxp = vector.add(pos, 1.5) local counts = 0 - if self.lava_damage > 0 then + if self.lava_damage > 1 then counts = minetest.find_nodes_in_area(minp, maxp, {"group:surface_hot"}) if #counts > 0 then - self.health = self.health - self.lava_damage + self.health = self.health - math.floor(self.lava_damage / 2) effect(pos, 5, "fire_basic_flame.png") end end @@ -78,6 +78,9 @@ fun_caves.custom_ready = function(self, delay) end +local fun_caves_stones = {'fun_caves:stone_with_moss', 'fun_caves:stone_with_lichen', 'fun_caves:stone_with_algae'} + + -- Try to standardize creature stats based on (log of) mass. local mob_stats = { @@ -497,7 +500,7 @@ if minetest.registered_entities["mobs_monster:spider"] then minetest.registered_entities["fun_caves:spider"] = m mobs.spawning_mobs["fun_caves:spider"] = true - mobs:register_spawn("fun_caves:spider", {"fun_caves:stone_with_moss", "fun_caves:stone_with_lichen", "fun_caves:stone_with_algae"}, 14, 0, 2000, 2, -51) + mobs:register_spawn("fun_caves:spider", fun_caves_stones, 14, 0, 2000, 2, -51) mobs:register_egg("fun_caves:spider", "Deep Spider", "mobs_cobweb.png", 1) @@ -560,7 +563,7 @@ if minetest.registered_entities["mobs_monster:spider"] then minetest.registered_entities["fun_caves:dangler"] = m mobs.spawning_mobs["fun_caves:dangler"] = true - mobs:register_spawn("fun_caves:dangler", {"fun_caves:stone_with_moss", "fun_caves:stone_with_lichen", "fun_caves:stone_with_algae"}, 14, 0, 1000, 3, -51) + mobs:register_spawn("fun_caves:dangler", fun_caves_stones, 14, 0, 1000, 3, -51) mobs:register_egg("fun_caves:dangler", "Dangling Spider", "mobs_cobweb.png", 1) @@ -636,6 +639,26 @@ end if minetest.registered_entities["mobs_monster:stone_monster"] then mobs:register_spawn("mobs_monster:stone_monster", {"fun_caves:pyramid_1"}, 20, 0, 300, 5, 31000) + local stones = table.copy(fun_caves_stones) + stones[#stones+1] = 'fun_caves:hot_cobble' + mobs:register_spawn("mobs_monster:stone_monster", stones, 7, 0, 7000, 1, 0) +end + +if minetest.registered_entities["mobs_monster:dungeon_master"] then + mobs:register_spawn("mobs_monster:dungeon_master", {"fun_caves:pyramid_1"}, 20, 0, 3500, 5, 31000) + local stones = table.copy(fun_caves_stones) + stones[#stones+1] = 'fun_caves:hot_cobble' + mobs:register_spawn("mobs_monster:dungeon_master", stones, 7, 0, 7000, 1, -70) +end + +if minetest.registered_entities["mobs_monster:oerkki"] then + mobs:register_spawn("mobs_monster:oerkki", fun_caves_stones, 7, 0, 7000, 1, -10) +end + +if minetest.registered_entities["mobs_monster:mese_monster"] then + local stones = table.copy(fun_caves_stones) + stones[#stones+1] = 'fun_caves:hot_cobble' + mobs:register_spawn("mobs_monster:mese_monster", stones, 7, 0, 5000, 1, -20) end -- Change the original, rather than making a copy. @@ -644,6 +667,10 @@ if minetest.registered_entities["dmobs:elephant"] then m.type = "monster" end +if minetest.registered_entities["mobs_bat:bat"] then + mobs:spawn_specific("mobs_bat:bat", {"air"}, fun_caves_stones, 0, 6, 30, 20000, 2, -31000, 11000) +end + if minetest.registered_entities["mobs_monster:dirt_monster"] then -- check this mobs:register_spawn("mobs_monster:dirt_monster", {"default:dirt"}, 7, 0, 4000, 1, -50) @@ -651,11 +678,12 @@ if minetest.registered_entities["mobs_monster:dirt_monster"] then 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", 'fun_caves:polluted_dirt'}, {"air"}, -1, 20, 30, 30000, 1, -31000, 31000 + local slime_surfaces = {"fun_caves:stone_with_moss", "fun_caves:stone_with_algae", 'fun_caves:polluted_dirt'} + mobs:spawn_specific("mobs_slimes:green_big", slime_surfaces, {"air"}, -1, 20, 30, 30000, 1, -31000, 31000 ) - mobs:spawn_specific("mobs_slimes:green_medium", {"fun_caves:stone_with_moss", "fun_caves:stone_with_algae", 'fun_caves:polluted_dirt'}, {"air"}, -1, 20, 30, 30000, 2, -31000, 31000 + mobs:spawn_specific("mobs_slimes:green_medium", slime_surfaces, {"air"}, -1, 20, 30, 30000, 2, -31000, 31000 ) - mobs:spawn_specific("mobs_slimes:green_small", {"fun_caves:stone_with_moss", "fun_caves:stone_with_algae", 'fun_caves:polluted_dirt'}, {"air"}, -1, 20, 30, 30000, 3, -31000, 31000 + mobs:spawn_specific("mobs_slimes:green_small", slime_surfaces, {"air"}, -1, 20, 30, 30000, 3, -31000, 31000 ) end