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

@ -72,6 +72,8 @@ mobs:register_mob("fun_caves:dangler", {
do_custom = function(self) do_custom = function(self)
fun_caves.climb(self) fun_caves.climb(self)
fun_caves.search_replace(self.object:getpos(), 200, {"air"}, "mobs:cobweb") fun_caves.search_replace(self.object:getpos(), 200, {"air"}, "mobs:cobweb")
fun_caves.surface_damage(self)
end, end,
}) })
@ -88,8 +90,10 @@ minetest.register_abm({
end end
}) })
-- cobweb -- cobweb
minetest.register_node(":mobs:cobweb", { if not minetest.registered_nodes['mobs:cobweb'] then
minetest.register_node(":mobs:cobweb", {
description = "Cobweb", description = "Cobweb",
drawtype = "plantlike", drawtype = "plantlike",
visual_scale = 1.1, visual_scale = 1.1,
@ -107,13 +111,14 @@ minetest.register_node(":mobs:cobweb", {
groups = {snappy = 1, liquid = 3}, groups = {snappy = 1, liquid = 3},
drop = "farming:cotton", drop = "farming:cotton",
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({
output = "mobs:cobweb", output = "mobs:cobweb",
recipe = { recipe = {
{"farming:string", "", "farming:string"}, {"farming:string", "", "farming:string"},
{"", "farming:string", ""}, {"", "farming:string", ""},
{"farming:string", "", "farming:string"}, {"farming:string", "", "farming:string"},
} }
}) })
end

View file

@ -1,4 +1,4 @@
default default
flowers flowers
wool wool
mobs? mobs

View file

@ -1,56 +0,0 @@
-- Dirt Monster by PilzAdam
mobs:register_mob("fun_caves:dirt_monster", {
type = "monster",
passive = false,
attack_type = "dogfight",
pathfinding = true,
reach = 2,
damage = 2,
hp_min = 3,
hp_max = 27,
armor = 100,
collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4},
visual = "mesh",
mesh = "mobs_stone_monster.b3d",
textures = {
{"mobs_dirt_monster.png"},
},
blood_texture = "default_dirt.png",
makes_footstep_sound = true,
sounds = {
random = "mobs_dirtmonster",
},
view_range = 15,
walk_velocity = 1,
run_velocity = 3,
jump = true,
drops = {
{name = "default:dirt", chance = 1, min = 3, max = 5},
},
water_damage = 1,
lava_damage = 5,
light_damage = 2,
fear_height = 4,
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 14,
walk_start = 15,
walk_end = 38,
run_start = 40,
run_end = 63,
punch_start = 40,
punch_end = 63,
},
})
mobs:register_spawn("fun_caves:dirt_monster",
{"default:dirt"}, 14, 0, 7000, 1, 31000)
mobs:register_egg("fun_caves:dirt_monster", "Dirt Monster", "default_dirt.png", 1)
-- compatibility
mobs:alias_mob("mobs:dirt_monster", "fun_caves:dirt_monster")

View file

@ -111,12 +111,14 @@ mobs:register_mob("fun_caves:goblin_coal", {
fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air")
fun_caves.search_replace(self.object:getpos(), 20, {"default:stone"}, "default:mossycobble") fun_caves.search_replace(self.object:getpos(), 20, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, {"group:stone"}, "fun_caves:stone_with_coal_trap") fun_caves.search_replace(self.object:getpos(), 50, {"group:stone"}, "fun_caves:stone_with_coal_trap")
fun_caves.surface_damage(self)
end, end,
}) })
mobs:register_egg("fun_caves:goblin_coal", "Goblin Egg (coal)", "default_mossycobble.png", 1) mobs:register_egg("fun_caves:goblin_coal", "Goblin Egg (coal)", "default_mossycobble.png", 1)
mobs:register_spawn("fun_caves:goblin_coal", {"default:coalblock", "default:stone_with_coal"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_coal", {"default:coalblock", "default:stone_with_coal"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, -50)
mobs:register_spawn("fun_caves:goblin_coal", {"default:mossycobble", "fun_caves:hot_cobble"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_coal", {"default:mossycobble", "fun_caves:hot_cobble"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, -50)
minetest.register_node("fun_caves:stone_with_coal_trap", { minetest.register_node("fun_caves:stone_with_coal_trap", {
description = "Coal Trap", description = "Coal Trap",

View file

@ -115,11 +115,13 @@ mobs:register_mob("fun_caves:goblin_cobble", {
fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air")
fun_caves.search_replace(self.object:getpos(), 5, {"default:stone"}, "default:mossycobble") fun_caves.search_replace(self.object:getpos(), 5, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, {"default:mossycobble"}, "fun_caves:mossycobble_trap") fun_caves.search_replace(self.object:getpos(), 50, {"default:mossycobble"}, "fun_caves:mossycobble_trap")
fun_caves.surface_damage(self)
end, end,
}) })
mobs:register_egg("fun_caves:goblin_cobble", "Goblin Egg (cobble)", "default_mossycobble.png", 1) mobs:register_egg("fun_caves:goblin_cobble", "Goblin Egg (cobble)", "default_mossycobble.png", 1)
mobs:register_spawn("fun_caves:goblin_cobble", {"group:stone"}, 100, 0, 10 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_cobble", {"group:stone"}, 100, 0, 10 * fun_caves.goblin_spawn_frequency, 3, -50)
mobs:register_spawn("fun_caves:goblin_cobble", {"default:mossycobble"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_cobble", {"default:mossycobble"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, -50)
minetest.register_node("fun_caves:mossycobble_trap", { minetest.register_node("fun_caves:mossycobble_trap", {
description = "Messy Gobblestone", description = "Messy Gobblestone",

View file

@ -111,11 +111,13 @@ mobs:register_mob("fun_caves:goblin_copper", {
fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air")
fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble") fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_copper_trap") fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_copper_trap")
fun_caves.surface_damage(self)
end, end,
}) })
mobs:register_egg("fun_caves:goblin_copper", "Goblin Egg (copper)", "default_mossycobble.png", 1) mobs:register_egg("fun_caves:goblin_copper", "Goblin Egg (copper)", "default_mossycobble.png", 1)
mobs:register_spawn("fun_caves:goblin_copper", {"default:stone_with_copper"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_copper", {"default:stone_with_copper"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, -50)
mobs:register_spawn("fun_caves:goblin_copper", {"default:mossycobble"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_copper", {"default:mossycobble"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, -50)
minetest.register_node("fun_caves:stone_with_copper_trap", { minetest.register_node("fun_caves:stone_with_copper_trap", {
description = "Copper Trap", description = "Copper Trap",

View file

@ -113,12 +113,14 @@ mobs:register_mob("fun_caves:goblin_diamond", {
fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air")
fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble") fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_diamond_trap") fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_diamond_trap")
fun_caves.surface_damage(self)
end, end,
}) })
mobs:register_egg("fun_caves:goblin_diamond", "Goblin Egg (diamond)", "default_mossycobble.png", 1) mobs:register_egg("fun_caves:goblin_diamond", "Goblin Egg (diamond)", "default_mossycobble.png", 1)
mobs:register_spawn("fun_caves:goblin_diamond", {"default:stone_with_diamond" }, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 2, 31000) mobs:register_spawn("fun_caves:goblin_diamond", {"default:stone_with_diamond" }, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 2, -50)
mobs:register_spawn("fun_caves:goblin_diamond", {"default:mossycobble", "fun_caves:hot_cobble"}, 100, 0, 2 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_diamond", {"default:mossycobble", "fun_caves:hot_cobble"}, 100, 0, 2 * fun_caves.goblin_spawn_frequency, 3, -50)
minetest.register_node("fun_caves:stone_with_diamond_trap", { minetest.register_node("fun_caves:stone_with_diamond_trap", {
description = "Diamond Trap", description = "Diamond Trap",

View file

@ -208,10 +208,12 @@ mobs:register_mob("fun_caves:goblin_digger", {
fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air")
fun_caves.search_replace(self.object:getpos(), 10, {"default:stone"}, "default:mossycobble") fun_caves.search_replace(self.object:getpos(), 10, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, {"default:mossycobble"}, "fun_caves:mossycobble_trap") fun_caves.search_replace(self.object:getpos(), 50, {"default:mossycobble"}, "fun_caves:mossycobble_trap")
fun_caves.surface_damage(self)
end, end,
}) })
mobs:register_egg("fun_caves:goblin_digger", "Goblin Egg (digger)", "default_mossycobble.png", 1) mobs:register_egg("fun_caves:goblin_digger", "Goblin Egg (digger)", "default_mossycobble.png", 1)
mobs:register_spawn("fun_caves:goblin_digger", {"group:stone"}, 100, 0, 20 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_digger", {"group:stone"}, 100, 0, 20 * fun_caves.goblin_spawn_frequency, 3, -50)
mobs:register_spawn("fun_caves:goblin_digger", {"default:mossycobble"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_digger", {"default:mossycobble"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, -50)

View file

@ -111,11 +111,13 @@ mobs:register_mob("fun_caves:goblin_gold", {
fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air")
fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble") fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_gold_trap") fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_gold_trap")
fun_caves.surface_damage(self)
end, end,
}) })
mobs:register_egg("fun_caves:goblin_gold", "Goblin Egg (gold)", "default_mossycobble.png", 1) mobs:register_egg("fun_caves:goblin_gold", "Goblin Egg (gold)", "default_mossycobble.png", 1)
mobs:register_spawn("fun_caves:goblin_gold", {"default:stone_with_gold" }, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 2, 31000) mobs:register_spawn("fun_caves:goblin_gold", {"default:stone_with_gold" }, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 2, -50)
mobs:register_spawn("fun_caves:goblin_gold", {"default:mossycobble", "fun_caves:hot_cobble"}, 100, 0, 2 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_gold", {"default:mossycobble", "fun_caves:hot_cobble"}, 100, 0, 2 * fun_caves.goblin_spawn_frequency, 3, -50)
minetest.register_node("fun_caves:molten_gold_source", { minetest.register_node("fun_caves:molten_gold_source", {
description = "Molten Gold Source", description = "Molten Gold Source",

View file

@ -110,11 +110,13 @@ mobs:register_mob("fun_caves:goblin_ice", {
fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air")
--fun_caves.search_replace(self.object:getpos(), 20, {"default:stone"}, "default:mossycobble") --fun_caves.search_replace(self.object:getpos(), 20, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, {"default:ice"}, "fun_caves:ice_trap") fun_caves.search_replace(self.object:getpos(), 50, {"default:ice"}, "fun_caves:ice_trap")
fun_caves.surface_damage(self, true)
end, end,
}) })
mobs:register_egg("fun_caves:goblin_ice", "Goblin Egg (ice)", "default_mossycobble.png", 1) mobs:register_egg("fun_caves:goblin_ice", "Goblin Egg (ice)", "default_mossycobble.png", 1)
mobs:register_spawn("fun_caves:goblin_ice", {"default:ice"}, 100, 0, 5 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_ice", {"default:ice"}, 100, 0, 5 * fun_caves.goblin_spawn_frequency, 3, -50)
minetest.register_node("fun_caves:ice_trap", { minetest.register_node("fun_caves:ice_trap", {
description = "Ice Trap", description = "Ice Trap",

View file

@ -113,11 +113,13 @@ mobs:register_mob("fun_caves:goblin_iron", {
fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air")
fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble") fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_iron_trap") fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_iron_trap")
fun_caves.surface_damage(self)
end, end,
}) })
mobs:register_egg("fun_caves:goblin_iron", "Goblin Egg (iron)", "default_mossycobble.png", 1) mobs:register_egg("fun_caves:goblin_iron", "Goblin Egg (iron)", "default_mossycobble.png", 1)
mobs:register_spawn("fun_caves:goblin_iron", {"default:stone_with_iron"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_iron", {"default:stone_with_iron"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 3, -50)
mobs:register_spawn("fun_caves:goblin_iron", {"default:mossycobble", "fun_caves:hot_cobble"}, 100, 0, 2 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_iron", {"default:mossycobble", "fun_caves:hot_cobble"}, 100, 0, 2 * fun_caves.goblin_spawn_frequency, 3, -50)
minetest.register_node("fun_caves:stone_with_iron_trap", { minetest.register_node("fun_caves:stone_with_iron_trap", {
description = "Iron Trap", description = "Iron Trap",

View file

@ -116,9 +116,11 @@ mobs:register_mob("fun_caves:goblin_king", {
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_copper_trap") fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_copper_trap")
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_gold_trap") fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_gold_trap")
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_iron_trap") fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_iron_trap")
fun_caves.surface_damage(self)
end, end,
}) })
mobs:register_egg("fun_caves:goblin_king", "Goblin King Egg", "default_mossycobble.png", 1) mobs:register_egg("fun_caves:goblin_king", "Goblin King Egg", "default_mossycobble.png", 1)
mobs:register_spawn("fun_caves:goblin_king", {"default:stone_with_mese"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 1, 31000) mobs:register_spawn("fun_caves:goblin_king", {"default:stone_with_mese"}, 100, 0, 1 * fun_caves.goblin_spawn_frequency, 1, -50)
mobs:register_spawn("fun_caves:goblin_king", {"default:mossycobble", "fun_caves:hot_cobble"}, 100, 0, 3 * fun_caves.goblin_spawn_frequency, 3, 31000) mobs:register_spawn("fun_caves:goblin_king", {"default:mossycobble", "fun_caves:hot_cobble"}, 100, 0, 3 * fun_caves.goblin_spawn_frequency, 3, -50)

View file

@ -5,52 +5,11 @@ fun_caves.world = false
fun_caves.time_factor = 10 fun_caves.time_factor = 10
if not mobs or not mobs.mod then
dofile(fun_caves.path .. "/mobs_api.lua")
end
--fun_caves.ores = {}
minetest.register_on_mapgen_init(function(mgparams) minetest.register_on_mapgen_init(function(mgparams)
--minetest.set_mapgen_params({mgname="singlenode", flags="nolight"})
minetest.set_mapgen_params({flags="nocaves,nodungeons"}) minetest.set_mapgen_params({flags="nocaves,nodungeons"})
--local ores = {}
--for id, ore_table in pairs(minetest.registered_ores) do
-- local ore = table.copy(ore_table)
-- local ore2 = table.copy(ore_table)
-- table.insert(fun_caves.ores, ore2)
-- ore.y_min = -31000
-- ore.y_max = 31000
-- table.insert(ores, ore)
-- print(dump(ore))
--end
--minetest.clear_registered_ores()
end) end)
--function fun_caves.set_ores(biome, y)
-- local ores = fun_caves.ores
--
-- --print("generating ores based on biome: "..biome)
-- local y_factor = (math.abs(biome) - 0.4) * -2000
-- --print("y_factor: "..y_factor)
--
-- minetest.clear_registered_ores()
-- for id, ore_table in pairs(ores) do
-- local ore = table.copy(ore_table)
-- if ore.y_max >= y_factor and y <= ore.y_max then
-- --if ore.y_max >= y_factor then
-- --print("using ore: "..ore.ore..", y_max: "..ore.y_max)
-- ore.y_min = -31000
-- ore.y_max = 31000
-- minetest.register_ore(ore)
-- end
-- end
--end
-- Check if the table contains an element. -- Check if the table contains an element.
function table.contains(table, element) function table.contains(table, element)
for key, value in pairs(table) do for key, value in pairs(table) do
@ -111,12 +70,5 @@ dofile(fun_caves.path .. "/mapgen.lua")
dofile(fun_caves.path .. "/mobs.lua") dofile(fun_caves.path .. "/mobs.lua")
--minetest.register_on_newplayer(fun_caves.respawn)
--minetest.register_on_respawnplayer(fun_caves.respawn)
-- Inserting helps to ensure that fun_caves operates first. -- Inserting helps to ensure that fun_caves operates first.
table.insert(minetest.registered_on_generateds, 1, fun_caves.generate) table.insert(minetest.registered_on_generateds, 1, fun_caves.generate)
--minetest.register_on_joinplayer(function(player)
-- player:set_sky("#000000", "plain", {})
--end)

View file

@ -1,142 +0,0 @@
-- Lava Flan by Zeg9 (additional textures by JurajVajda)
mobs:register_mob("fun_caves:lava_flan", {
type = "monster",
passive = false,
attack_type = "dogfight",
reach = 2,
damage = 3,
hp_min = 10,
hp_max = 35,
armor = 80,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5},
visual = "mesh",
mesh = "zmobs_lava_flan.x",
textures = {
{"zmobs_lava_flan.png"},
{"zmobs_lava_flan2.png"},
{"zmobs_lava_flan3.png"},
},
blood_texture = "fire_basic_flame.png",
makes_footstep_sound = false,
sounds = {
random = "mobs_lavaflan",
war_cry = "mobs_lavaflan",
},
walk_velocity = 0.5,
run_velocity = 2,
jump = true,
view_range = 10,
floats = 1,
drops = {
{name = "mobs:lava_orb", chance = 15, min = 1, max = 1},
},
water_damage = 5,
cold_damage = 5,
lava_damage = 0,
light_damage = 0,
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 8,
walk_start = 10,
walk_end = 18,
run_start = 20,
run_end = 28,
punch_start = 20,
punch_end = 28,
},
on_die = function(self, pos)
minetest.set_node(pos, {name = "fire:basic_flame"})
end,
})
mobs:register_spawn("fun_caves:lava_flan", {"default:lava_source"}, 15, 0, 1000, 2, 31000)
mobs:register_egg("fun_caves:lava_flan", "Lava Flan", "default_lava.png", 1)
-- compatibility
mobs:alias_mob("mobs:lava_flan", "fun_caves:lava_flan")
-- lava orb
minetest.register_craftitem(":mobs:lava_orb", {
description = "Lava orb",
inventory_image = "zmobs_lava_orb.png",
})
minetest.register_alias("zmobs:lava_orb", "mobs:lava_orb")
minetest.register_craft({
type = "fuel",
recipe = "mobs:lava_orb",
burntime = 80,
})
-- Lava Pick (digs and smelts at same time)
local old_handle_node_drops = minetest.handle_node_drops
function minetest.handle_node_drops(pos, drops, digger)
-- are we holding Lava Pick?
if digger:get_wielded_item():get_name() ~= ("mobs:pick_lava") then
return old_handle_node_drops(pos, drops, digger)
end
-- reset new smelted drops
local hot_drops = {}
-- loop through current node drops
for _, drop in pairs(drops) do
-- get cooked output of current drops
local stack = ItemStack(drop)
local output = minetest.get_craft_result({
method = "cooking",
width = 1,
items = {drop}
})
-- if we have cooked result then add to new list
if output
and output.item
and not output.item:is_empty() then
table.insert(hot_drops,
ItemStack({
name = output.item:get_name(),
count = stack:get_count()
})
)
else -- if not then return normal drops
table.insert(hot_drops, stack)
end
end
return old_handle_node_drops(pos, hot_drops, digger)
end
minetest.register_tool(":mobs:pick_lava", {
description = "Lava Pickaxe",
inventory_image = "mobs_pick_lava.png",
tool_capabilities = {
full_punch_interval = 0.4,
max_drop_level=3,
groupcaps={
cracky = {times={[1]=1.80, [2]=0.90, [3]=0.45}, uses=30, maxlevel=3},
},
damage_groups = {fleshy=6},
},
})
minetest.register_craft({
output = "mobs:pick_lava",
recipe = {
{"mobs:lava_orb", "mobs:lava_orb", "mobs:lava_orb"},
{"", "default:obsidian_shard", ""},
{"", "default:obsidian_shard", ""},
}
})

View file

@ -235,7 +235,7 @@ function fun_caves.generate(p_minp, p_maxp, seed)
biome_val = biome_val / math.max(1, math.log(500 - (heightmap[index] - y))) biome_val = biome_val / math.max(1, math.log(500 - (heightmap[index] - y)))
end end
------------------- -------------------
--biome_val = 0.3 --biome_val = 0.7
------------------- -------------------
if biome_val < -0.6 then if biome_val < -0.6 then
if true then if true then

View file

@ -16,18 +16,49 @@ fun_caves.search_replace = function(pos, search_rate, replace_what, replace_with
end end
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 .. "/danglers.lua")
dofile(fun_caves.path .. "/spider.lua") dofile(fun_caves.path .. "/spider.lua")
dofile(fun_caves.path .. "/spider_ice.lua") dofile(fun_caves.path .. "/spider_ice.lua")
dofile(fun_caves.path .. "/dirt_monster.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 .. "/sand_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_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" } fun_caves.goblin_drops = { "default:pick_steel", "default:sword_steel", "default:shovel_steel", "farming:bread", "bucket:bucket_water", "default:pick_stone", "default:sword_stone" }

File diff suppressed because it is too large Load diff

View file

@ -1,69 +0,0 @@
-- name tag
minetest.register_craftitem(":mobs:nametag", {
description = "Nametag",
inventory_image = "mobs_nametag.png",
})
core.register_craft({
type = "shapeless",
output = "mobs:nametag",
recipe = {"default:paper", "dye:black", "farming:string"},
})
-- leather
minetest.register_craftitem(":mobs:leather", {
description = "Leather",
inventory_image = "mobs_leather.png",
})
-- raw meat
minetest.register_craftitem(":mobs:meat_raw", {
description = "Raw Meat",
inventory_image = "mobs_meat_raw.png",
on_use = minetest.item_eat(3),
})
-- cooked meat
minetest.register_craftitem(":mobs:meat", {
description = "Meat",
inventory_image = "mobs_meat.png",
on_use = minetest.item_eat(8),
})
minetest.register_craft({
type = "cooking",
output = "mobs:meat",
recipe = "mobs:meat_raw",
cooktime = 5,
})
-- golden lasso
minetest.register_tool(":mobs:magic_lasso", {
description = "Magic Lasso (right-click animal to put in inventory)",
inventory_image = "mobs_magic_lasso.png",
})
minetest.register_craft({
output = "mobs:magic_lasso",
recipe = {
{"farming:string", "default:gold_lump", "farming:string"},
{"default:gold_lump", "default:diamondblock", "default:gold_lump"},
{"farming:string", "default:gold_lump", "farming:string"},
}
})
-- net
minetest.register_tool(":mobs:net", {
description = "Net (right-click animal to put in inventory)",
inventory_image = "mobs_net.png",
})
minetest.register_craft({
output = "mobs:net",
recipe = {
{"default:stick", "", "default:stick"},
{"default:stick", "", "default:stick"},
{"farming:string", "default:stick", "farming:string"},
}
})

View file

@ -47,9 +47,6 @@ mobs:register_mob("fun_caves:sand_monster", {
}, },
}) })
mobs:register_spawn("fun_caves:sand_monster", {"group:sand"}, 20, 0, 4000, 3, 31000) mobs:register_spawn("fun_caves:sand_monster", {"group:sand"}, 20, 0, 4000, 3, -50)
mobs:register_egg("fun_caves:sand_monster", "Sand Monster", "default_sand.png", 1) mobs:register_egg("fun_caves:sand_monster", "Deep Sand Monster", "default_sand.png", 1)
-- compatibility
mobs:alias_mob("mobs:sand_monster", "fun_caves:sand_monster")

View file

@ -47,11 +47,15 @@ mobs:register_mob("fun_caves:spider", {
punch_start = 50, punch_start = 50,
punch_end = 90, punch_end = 90,
}, },
do_custom = function(self)
if not self.fun_caves_damage_timer then
self.fun_caves_damage_timer = 0
end
fun_caves.surface_damage(self)
end,
}) })
mobs:register_spawn("fun_caves:spider", {"fun_caves:stone_with_moss", "fun_caves:stone_with_lichen", "fun_caves:stone_with_algae"}, 14, 0, 5000, 2, 31000) mobs:register_spawn("fun_caves:spider", {"fun_caves:stone_with_moss", "fun_caves:stone_with_lichen", "fun_caves:stone_with_algae"}, 14, 0, 5000, 2, 31000)
mobs:register_egg("fun_caves:spider", "Spider", "mobs_cobweb.png", 1) mobs:register_egg("fun_caves:spider", "Deep Spider", "mobs_cobweb.png", 1)
-- compatibility
mobs:alias_mob("mobs:spider", "fun_caves:spider")

View file

@ -48,6 +48,9 @@ mobs:register_mob("fun_caves:spider_ice", {
punch_start = 50, punch_start = 50,
punch_end = 90, punch_end = 90,
}, },
do_custom = function(self)
fun_caves.surface_damage(self, true)
end,
}) })
mobs:register_spawn("fun_caves:spider_ice", {"default:ice"}, 14, 0, 1000, 2, 31000) mobs:register_spawn("fun_caves:spider_ice", {"default:ice"}, 14, 0, 1000, 2, 31000)

View file

@ -1,57 +0,0 @@
-- Stone Monster by PilzAdam
mobs:register_mob("fun_caves:stone_monster", {
type = "monster",
passive = false,
attack_type = "dogfight",
pathfinding = true,
reach = 2,
damage = 3,
hp_min = 12,
hp_max = 35,
armor = 80,
collisionbox = {-0.4, -1, -0.4, 0.4, 0.9, 0.4},
visual = "mesh",
mesh = "mobs_stone_monster.b3d",
textures = {
{"mobs_stone_monster.png"},
{"mobs_stone_monster2.png"}, -- by AMMOnym
},
makes_footstep_sound = true,
sounds = {
random = "mobs_stonemonster",
},
walk_velocity = 1,
run_velocity = 2,
jump = true,
floats = 0,
view_range = 10,
drops = {
{name = "default:torch", chance = 2, min = 3, max = 5},
{name = "default:iron_lump", chance = 5, min = 1, max = 2},
{name = "default:coal_lump", chance = 3, min = 1, max = 3},
},
water_damage = 0,
lava_damage = 1,
light_damage = 0,
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 14,
walk_start = 15,
walk_end = 38,
run_start = 40,
run_end = 63,
punch_start = 40,
punch_end = 63,
},
})
mobs:register_spawn("fun_caves:stone_monster", {"default:stone", "default:desert_stone", "fun_caves:stone_with_salt"}, 14, 0, 7000, 1, 31000)
mobs:register_egg("fun_caves:stone_monster", "Stone Monster", "default_stone.png", 1)
-- compatibility
mobs:alias_mob("mobs:stone_monster", "fun_caves:stone_monster")