2020-10-26 17:38:53 +01:00
|
|
|
|
|
|
|
-- local variables
|
2024-12-19 12:55:40 +01:00
|
|
|
|
|
|
|
local l_spawn_chance_gull = 24000
|
|
|
|
local l_spawn_chance_bird = 36000
|
2020-10-26 17:38:53 +01:00
|
|
|
|
|
|
|
-- load settings
|
2021-03-17 20:30:38 +01:00
|
|
|
|
2024-12-19 12:55:40 +01:00
|
|
|
local ENABLE_GULLS = minetest.settings:get_bool("mobs_birds.enable_gulls") ~= false
|
|
|
|
local ENABLE_LARGE = minetest.settings:get_bool("mobs_birds.enable_large_birds") ~= false
|
|
|
|
local ENABLE_SMALL = minetest.settings:get_bool("mobs_birds.enable_small_birds") ~= false
|
|
|
|
|
|
|
|
if not ENABLE_LARGE then
|
2020-10-26 17:38:53 +01:00
|
|
|
l_spawn_chance_bird = l_spawn_chance_bird - 18000
|
|
|
|
end
|
2021-03-17 20:30:38 +01:00
|
|
|
|
2024-12-19 12:55:40 +01:00
|
|
|
if not ENABLE_SMALL then
|
2020-10-26 17:38:53 +01:00
|
|
|
l_spawn_chance_bird = l_spawn_chance_bird - 18000
|
|
|
|
end
|
|
|
|
|
2024-12-19 12:55:40 +01:00
|
|
|
-- Mineclone check
|
|
|
|
|
|
|
|
local mod_mcl = minetest.get_modpath("mcl_core")
|
2021-03-17 20:30:38 +01:00
|
|
|
|
2020-10-26 17:38:53 +01:00
|
|
|
-- gulls
|
2024-12-19 12:55:40 +01:00
|
|
|
|
2020-10-26 17:38:53 +01:00
|
|
|
if ENABLE_GULLS then
|
|
|
|
|
|
|
|
mobs:register_mob("mobs_birds:gull", {
|
|
|
|
type = "animal",
|
|
|
|
passive = true,
|
|
|
|
hp_min = 5,
|
|
|
|
hp_max = 10,
|
|
|
|
armor = 100,
|
|
|
|
collisionbox = {-1, -0.3, -1, 1, 0.3, 1},
|
|
|
|
visual = "mesh",
|
2021-03-17 20:30:38 +01:00
|
|
|
mesh = "animal_gull.b3d",
|
|
|
|
textures = {
|
|
|
|
{"animal_gull_mesh.png"},
|
|
|
|
{"gull_black.png"},
|
|
|
|
{"gull_gray.png"},
|
|
|
|
{"gull_grayblue.png"}
|
|
|
|
},
|
2020-10-26 17:38:53 +01:00
|
|
|
rotate = 270,
|
|
|
|
walk_velocity = 4,
|
|
|
|
run_velocity = 6,
|
|
|
|
fall_speed = 0,
|
|
|
|
stepheight = 3,
|
|
|
|
fly = true,
|
|
|
|
keep_flying = true,
|
|
|
|
water_damage = 0,
|
|
|
|
lava_damage = 10,
|
|
|
|
light_damage = 0,
|
|
|
|
view_range = 14,
|
2021-03-17 20:30:38 +01:00
|
|
|
animation = {
|
2024-12-19 12:55:40 +01:00
|
|
|
speed_normal = 24, speed_run = 24,
|
|
|
|
stand_start = 1, stand_end = 95,
|
|
|
|
walk_start = 1, walk_end = 95,
|
|
|
|
fly_start = 1, fly_end = 95,
|
|
|
|
run_start = 1, run_end = 95
|
2021-03-17 20:30:38 +01:00
|
|
|
},
|
2024-12-19 12:55:40 +01:00
|
|
|
|
2020-10-26 17:38:53 +01:00
|
|
|
on_rightclick = function(self, clicker)
|
2021-03-17 20:30:38 +01:00
|
|
|
mobs:capture_mob(self, clicker, 5, 60, 0, true, nil)
|
2020-10-26 17:38:53 +01:00
|
|
|
end
|
|
|
|
})
|
|
|
|
|
2021-03-17 20:30:38 +01:00
|
|
|
mobs:register_egg("mobs_birds:gull", "Gull", "default_cloud.png", 1)
|
2020-10-26 17:38:53 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
-- large birds
|
2024-12-19 12:55:40 +01:00
|
|
|
|
|
|
|
if ENABLE_LARGE then
|
2020-10-26 17:38:53 +01:00
|
|
|
|
|
|
|
mobs:register_mob("mobs_birds:bird_lg", {
|
|
|
|
type = "animal",
|
|
|
|
passive = true,
|
|
|
|
hp_min = 5,
|
|
|
|
hp_max = 10,
|
|
|
|
armor = 100,
|
|
|
|
collisionbox = {-0.5, -0.3, -0.5, 0.5, 0.3, 0.5},
|
|
|
|
visual = "mesh",
|
2021-03-17 20:30:38 +01:00
|
|
|
mesh = "animal_gull.b3d",
|
|
|
|
textures = {
|
|
|
|
{"bird_blueish.png"},
|
|
|
|
{"bird_brown.png"},
|
|
|
|
{"bird_gray.png"},
|
|
|
|
{"bird_grayblue.png"},
|
|
|
|
{"bird_red.png"},
|
|
|
|
{"bird_redish.png"}
|
|
|
|
},
|
2020-10-26 17:38:53 +01:00
|
|
|
visual_size = {x = .5, y = .5},
|
|
|
|
rotate = 270,
|
|
|
|
walk_velocity = 4,
|
|
|
|
run_velocity = 6,
|
|
|
|
fall_speed = 0,
|
|
|
|
stepheight = 3,
|
|
|
|
fly = true,
|
|
|
|
keep_flying = true,
|
|
|
|
water_damage = 0,
|
|
|
|
lava_damage = 10,
|
|
|
|
light_damage = 0,
|
|
|
|
view_range = 12,
|
2021-03-17 20:30:38 +01:00
|
|
|
animation = {
|
2024-12-19 12:55:40 +01:00
|
|
|
speed_normal = 24, speed_run = 24,
|
|
|
|
stand_start = 1, stand_end = 95,
|
|
|
|
walk_start = 1, walk_end = 95,
|
|
|
|
run_start = 1, run_end = 95
|
2021-03-17 20:30:38 +01:00
|
|
|
},
|
2024-12-19 12:55:40 +01:00
|
|
|
|
2020-10-26 17:38:53 +01:00
|
|
|
on_rightclick = function(self, clicker)
|
2021-03-17 20:30:38 +01:00
|
|
|
mobs:capture_mob(self, clicker, 5, 60, 0, true, nil)
|
2020-10-26 17:38:53 +01:00
|
|
|
end
|
|
|
|
})
|
|
|
|
|
2021-03-17 20:30:38 +01:00
|
|
|
mobs:register_egg("mobs_birds:bird_lg", "Large bird", "default_cloud.png", 1)
|
2020-10-26 17:38:53 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
-- small birds
|
2024-12-19 12:55:40 +01:00
|
|
|
|
|
|
|
if ENABLE_SMALL then
|
2020-10-26 17:38:53 +01:00
|
|
|
|
|
|
|
mobs:register_mob("mobs_birds:bird_sm", {
|
|
|
|
type = "animal",
|
|
|
|
passive = true,
|
|
|
|
hp_min = 2,
|
|
|
|
hp_max = 5,
|
|
|
|
armor = 100,
|
|
|
|
collisionbox = {-0.25, -0.3, -0.25, 0.25, 0.3, 0.25},
|
|
|
|
visual = "mesh",
|
2021-03-17 20:30:38 +01:00
|
|
|
mesh = "animal_gull.b3d",
|
|
|
|
textures = {
|
|
|
|
{"bird_blueish.png"},
|
|
|
|
{"bird_brown.png"},
|
|
|
|
{"bird_gray.png"},
|
|
|
|
{"bird_grayblue.png"},
|
|
|
|
{"bird_red.png"},
|
|
|
|
{"bird_redish.png"}
|
|
|
|
},
|
2020-10-26 17:38:53 +01:00
|
|
|
visual_size = {x = .25, y = .25},
|
|
|
|
rotate = 270,
|
|
|
|
walk_velocity = 4,
|
|
|
|
run_velocity = 6,
|
|
|
|
fall_speed = 0,
|
|
|
|
stepheight = 3,
|
|
|
|
fly = true,
|
|
|
|
keep_flying = true,
|
|
|
|
water_damage = 0,
|
|
|
|
lava_damage = 10,
|
|
|
|
light_damage = 0,
|
|
|
|
view_range = 10,
|
2021-03-17 20:30:38 +01:00
|
|
|
animation = {
|
2024-12-19 12:55:40 +01:00
|
|
|
speed_normal = 24, speed_run = 24,
|
|
|
|
stand_start = 1, stand_end = 95,
|
|
|
|
walk_start = 1, walk_end = 95,
|
|
|
|
run_start = 1, run_end = 95
|
2021-03-17 20:30:38 +01:00
|
|
|
},
|
2024-12-19 12:55:40 +01:00
|
|
|
|
2020-10-26 17:38:53 +01:00
|
|
|
on_rightclick = function(self, clicker)
|
2021-03-17 20:30:38 +01:00
|
|
|
mobs:capture_mob(self, clicker, 5, 60, 0, true, nil)
|
2020-10-26 17:38:53 +01:00
|
|
|
end
|
|
|
|
})
|
|
|
|
|
2021-03-17 20:30:38 +01:00
|
|
|
mobs:register_egg("mobs_birds:bird_sm", "Small bird", "default_cloud.png", 1)
|
2020-10-26 17:38:53 +01:00
|
|
|
end
|
2024-12-19 12:55:40 +01:00
|
|
|
|
|
|
|
-- Check for custom spawn.lua
|
|
|
|
|
|
|
|
local MP = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
|
|
|
local input = io.open(MP .. "spawn.lua", "r")
|
|
|
|
|
|
|
|
if input then
|
|
|
|
input:close() ; input = nil ; dofile(MP .. "spawn.lua")
|
|
|
|
else
|
|
|
|
if ENABLE_GULL then
|
|
|
|
|
|
|
|
mobs:spawn({
|
|
|
|
name = "mobs_birds:gull",
|
|
|
|
nodes = {"air"},
|
|
|
|
neighbors = {"group:water"},
|
|
|
|
max_light = 5,
|
|
|
|
interval = 30,
|
|
|
|
chance = l_spawn_chance_gull,
|
|
|
|
min_height = 0,
|
|
|
|
max_height = 200
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
if ENABLE_SMALL then
|
|
|
|
|
|
|
|
mobs:spawn({
|
|
|
|
name = "mobs_birds:bird_sm",
|
|
|
|
nodes = {"air"},
|
|
|
|
neighbors = {
|
|
|
|
"group:leaves" , (mod_mcl and "mcl_core:cactus" or "default:cactus")
|
|
|
|
},
|
|
|
|
max_light = 5,
|
|
|
|
interval = 30,
|
|
|
|
chance = l_spawn_chance_bird,
|
|
|
|
min_height = 0,
|
|
|
|
max_height = 200
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
if ENABLE_LARGE then
|
|
|
|
|
|
|
|
mobs:spawn({
|
|
|
|
name = "mobs_birds:bird_lg",
|
|
|
|
nodes = {"air"},
|
|
|
|
neighbors = {
|
|
|
|
"group:leaves" , (mod_mcl and "mcl_core:cactus" or "default:cactus")
|
|
|
|
},
|
|
|
|
max_light = 5,
|
|
|
|
interval = 30,
|
|
|
|
chance = l_spawn_chance_bird,
|
|
|
|
min_height = 0,
|
|
|
|
max_height = 200
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
print("[MOD] Mobs Redo Birds loaded")
|