Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Sys Quatre 2020-09-21 18:06:40 +02:00
commit 5297dfbbdf
11 changed files with 225 additions and 14 deletions

View File

@ -58,6 +58,7 @@ if minetest.get_modpath("ethereal") then
spawn_on = "ethereal:gray_dirt"
end
if not mobs.custom_spawn_monster then
mobs:spawn({
name = "mobs_monster:dirt_monster",
nodes = {spawn_on},
@ -68,6 +69,7 @@ mobs:spawn({
min_height = 0,
day_toggle = false,
})
end
mobs:register_egg("mobs_monster:dirt_monster", S("Dirt Monster"), "default_dirt.png", 1)

View File

@ -65,6 +65,7 @@ mobs:register_mob("mobs_monster:dungeon_master", {
})
if not mobs.custom_spawn_monster then
mobs:spawn({
name = "mobs_monster:dungeon_master",
nodes = {"default:stone", "default:sandstone", "nether:netherrack"},
@ -73,6 +74,7 @@ mobs:spawn({
active_object_count = 1,
max_height = -70,
})
end
mobs:register_egg("mobs_monster:dungeon_master", S("Dungeon Master"), "fire_basic_flame.png", 1, true)

View File

@ -1,23 +1,44 @@
-- Load support for intllib.
local path = minetest.get_modpath(minetest.get_current_modname())
local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"
local S = minetest.get_translator and minetest.get_translator("mobs_monster") or
dofile(path .. "/intllib.lua")
dofile(path .. "intllib.lua")
mobs.intllib = S
-- Check for custom mob spawn file
local input = io.open(path .. "spawn.lua", "r")
if input then
mobs.custom_spawn_monster = true
input:close()
input = nil
end
-- Monsters
dofile(path .. "/dirt_monster.lua") -- PilzAdam
dofile(path .. "/dungeon_master.lua")
dofile(path .. "/oerkki.lua")
dofile(path .. "/sand_monster.lua")
dofile(path .. "/stone_monster.lua")
dofile(path .. "/tree_monster.lua")
dofile(path .. "/lava_flan.lua") -- Zeg9
dofile(path .. "/mese_monster.lua")
dofile(path .. "/spider.lua") -- AspireMint
dofile(path .. "/minotaur.lua") -- NALC(sys4 fork MFF) Kalabasa
dofile(path .. "dirt_monster.lua") -- PilzAdam
dofile(path .. "dungeon_master.lua")
dofile(path .. "oerkki.lua")
dofile(path .. "sand_monster.lua")
dofile(path .. "stone_monster.lua")
dofile(path .. "tree_monster.lua")
dofile(path .. "lava_flan.lua") -- Zeg9
dofile(path .. "mese_monster.lua")
dofile(path .. "spider.lua") -- AspireMint
dofile(path .. "minotaur.lua") -- NALC(sys4 fork MFF) Kalabasa
-- Load custom spawning
if mobs.custom_spawn_monster then
dofile(path .. "spawn.lua")
end
-- Lucky Blocks
dofile(path .. "/lucky_block.lua")
dofile(path .. "lucky_block.lua")
print (S("[MOD] Mobs Redo Monsters loaded"))

View File

@ -89,6 +89,7 @@ mobs:register_mob("mobs_monster:lava_flan", {
})
if not mobs.custom_spawn_monster then
mobs:spawn({
name = "mobs_monster:lava_flan",
nodes = {"default:lava_source"},
@ -96,6 +97,7 @@ mobs:spawn({
active_object_count = 1,
max_height = 0,
})
end
mobs:register_egg("mobs_monster:lava_flan", S("Lava Flan"), "default_lava.png", 1)

View File

@ -58,6 +58,7 @@ mobs:register_mob("mobs_monster:mese_monster", {
})
if not mobs.custom_spawn_monster then
mobs:spawn({
name = "mobs_monster:mese_monster",
nodes = {"default:stone", "default:sandstone"},
@ -66,6 +67,7 @@ mobs:spawn({
active_object_count = 1,
max_height = -20,
})
end
mobs:register_egg("mobs_monster:mese_monster", S("Mese Monster"), "default_mese_block.png", 1)

View File

@ -61,6 +61,7 @@ mobs:register_mob("mobs_monster:oerkki", {
})
if not mobs.custom_spawn_monster then
mobs:spawn({
name = "mobs_monster:oerkki",
nodes = {"default:stone"},
@ -68,6 +69,7 @@ mobs:spawn({
chance = 7000,
max_height = -10,
})
end
mobs:register_egg("mobs_monster:oerkki", S("Oerkki"), "default_obsidian.png", 1)

View File

@ -117,7 +117,7 @@ mobs:register_mob("mobs_monster:sand_monster", {
]]
})
if not mobs.custom_spawn_monster then
mobs:spawn({
name = "mobs_monster:sand_monster",
nodes = {"default:desert_sand"},
@ -125,6 +125,7 @@ mobs:spawn({
active_object_count = 2,
min_height = 0,
})
end
mobs:register_egg("mobs_monster:sand_monster", S("Sand Monster"), "default_desert_sand.png", 1)

173
spawn_example.lua Normal file
View File

@ -0,0 +1,173 @@
--[[ Spawn Template, defaults to values shown if line not provided
mobs:spawn({
name = "",
- Name of mob, must be provided e.g. "mymod:my_mob"
nodes = {"group:soil, "group:stone"},
- Nodes to spawn on top of.
neighbors = {"air"},
- Nodes to spawn beside.
min_light = 0,
- Minimum light level.
max_light = 15,
- Maximum light level, 15 is sunlight only.
interval = 30,
- Spawn interval in seconds.
chance = 5000,
- Spawn chance, 1 in every 5000 nodes.
active_object_count = 1,
- Active mobs of this type in area.
min_height = -31000,
- Minimum height level.
max_height = 31000,
- Maximum height level.
day_toggle = nil,
- Daytime toggle, true to spawn during day, false for night, nil for both
on_spawn = nil,
- On spawn function to run when mob spawns in world
on_map_load = nil,
- On map load, when true mob only spawns in newly generated map areas
})
]]--
-- Dirt Monster
mobs:spawn({
name = "mobs_monster:dirt_monster",
nodes = {"default:dirt_with_grass"},
min_light = 0,
max_light = 7,
chance = 6000,
active_object_count = 2,
min_height = 0,
day_toggle = false,
})
-- Dungeon Master
mobs:spawn({
name = "mobs_monster:dungeon_master",
nodes = {"default:stone"},
max_light = 5,
chance = 9000,
active_object_count = 1,
max_height = -70,
})
-- Lava Flan
mobs:spawn({
name = "mobs_monster:lava_flan",
nodes = {"default:lava_source"},
chance = 1500,
active_object_count = 1,
max_height = 0,
})
-- Mese Monster
mobs:spawn({
name = "mobs_monster:mese_monster",
nodes = {"default:stone"},
max_light = 7,
chance = 5000,
active_object_count = 1,
max_height = -20,
})
-- Oerkki
mobs:spawn({
name = "mobs_monster:oerkki",
nodes = {"default:stone"},
max_light = 7,
chance = 7000,
max_height = -10,
})
-- Sand Monster
mobs:spawn({
name = "mobs_monster:sand_monster",
nodes = {"default:desert_sand"},
chance = 7000,
active_object_count = 2,
min_height = 0,
})
-- Spider (above ground)
mobs:spawn({
name = "mobs_monster:spider",
nodes = {
"default:dirt_with_rainforest_litter", "default:snowblock",
"default:snow", "ethereal:crystal_dirt", "ethereal:cold_dirt"
},
min_light = 0,
max_light = 8,
chance = 7000,
active_object_count = 1,
min_height = 25,
max_height = 31000,
})
-- Spider (below ground)
mobs:spawn({
name = "mobs_monster:spider",
nodes = {"default:stone_with_mese", "default:mese", "default:stone"},
min_light = 0,
max_light = 7,
chance = 7000,
active_object_count = 1,
min_height = -31000,
max_height = -40,
})
-- Stone Monster
mobs:spawn({
name = "mobs_monster:stone_monster",
nodes = {"default:stone", "default:desert_stone", "default:sandstone"},
max_light = 7,
chance = 7000,
max_height = 0,
})
-- Tree Monster
mobs:spawn({
name = "mobs_monster:tree_monster",
nodes = {"default:leaves", "default:jungleleaves"},
max_light = 7,
chance = 7000,
min_height = 0,
day_toggle = false,
})

View File

@ -179,6 +179,7 @@ mobs:register_mob("mobs_monster:spider", {
})
if not mobs.custom_spawn_monster then
-- above ground spawn
mobs:spawn({
name = "mobs_monster:spider",
@ -205,6 +206,7 @@ mobs:spawn({
min_height = -31000,
max_height = -40,
})
end
mobs:register_egg("mobs_monster:spider", S("Spider"), "mobs_cobweb.png", 1)

View File

@ -64,6 +64,7 @@ mobs:register_mob("mobs_monster:stone_monster", {
})
if not mobs.custom_spawn_monster then
mobs:spawn({
name = "mobs_monster:stone_monster",
nodes = {"default:stone", "default:desert_stone", "default:sandstone"},
@ -71,6 +72,7 @@ mobs:spawn({
chance = 7000,
max_height = 0,
})
end
mobs:register_egg("mobs_monster:stone_monster", S("Stone Monster"), "default_stone.png", 1)

View File

@ -69,6 +69,7 @@ mobs:register_mob("mobs_monster:tree_monster", {
})
if not mobs.custom_spawn_monster then
mobs:spawn({
name = "mobs_monster:tree_monster",
nodes = {"default:leaves", "default:jungleleaves", "moretrees:beech_leaves"},
@ -77,6 +78,7 @@ mobs:spawn({
min_height = 0,
day_toggle = false,
})
end
mobs:register_egg("mobs_monster:tree_monster", S("Tree Monster"), "default_tree_top.png", 1)