mckaygerhard b17db3b7e2 upgrade animal mobs part to 20240101 version, fixed bugs and tune it
* added settings to disable specific animals
* honey blocks and beehives aren't ground content
  closes https://codeberg.org/tenplus1/mobs_animal/pulls/1
  closes https://github.com/pandorabox-io/pandorabox.io#836
* Many node definitions seem to have not set is_ground_content to false,
  means jumping a ship near mapblocks that haven't been generated yet,
  can lead to loss of ships or at least parts of it.
* chickens eat seed on ground, so add farming dependency missing
* backported the have chance of chicken dropping a feather
* backported commit bf12043fdcab68acfef299e26b6896a918ce1512
  from bf12043fdc
* way to detect newer engines, for the sound_play extra parameter
  cherry picked from commit e644a1b52343c5c7e821d53c8b2f6dc9751a16fc
  backported from e644a1b523
  minetest.sound_play uses optional parameter only in 5.3+ so
  autodetectting for future uses
* add nil check to sheepy, fix warning msg when dye'ing sheep
2024-03-31 01:58:01 -04:00

93 lines
2.0 KiB
Lua

local S = mobs.intllib_animal
-- Panda by AspireMint (CC BY-SA 3.0)
mobs:register_mob(":mobs_animal:panda", {
stepheight = 0.6,
type = "animal",
passive = false,
attack_type = "dogfight",
group_attack = false,
owner_loyal = true,
attack_npcs = false,
reach = 2,
damage = 3,
hp_min = 10,
hp_max = 24,
armor = 200,
collisionbox = {-0.4, -0.45, -0.4, 0.4, 0.45, 0.4},
visual = "mesh",
mesh = "mobs_panda.b3d",
textures = {
{"mobs_panda.png"}
},
makes_footstep_sound = true,
sounds = {
random = "mobs_panda",
attack = "mobs_panda"
},
walk_chance = 5,
walk_velocity = 0.5,
run_velocity = 1.5,
jump = false,
jump_height = 6,
follow = {"ethereal:bamboo", "bamboo:trunk", "default:papyrus"},
view_range = 8,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 2}
},
water_damage = 0.01,
lava_damage = 5,
light_damage = 0,
fear_height = 6,
animation = {
speed_normal = 15,
stand_start = 130,
stand_end = 270,
stand1_start = 0,
stand1_end = 0,
stand2_start = 1,
stand2_end = 1,
stand3_start = 2,
stand3_end = 2,
walk_start = 10,
walk_end = 70,
run_start = 10,
run_end = 70,
punch_start = 80,
punch_end = 120,
-- 0 = rest, 1 = hiding (covers eyes), 2 = surprised
},
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 20, true, true) then return end
if mobs:protect(self, clicker) then return end
if mobs:capture_mob(self, clicker, 0, 5, 50, false, nil) then return end
end
})
local spawn_on = {"default:dirt_with_grass"}
if minetest.get_modpath("ethereal") then spawn_on = {"ethereal:bamboo_dirt", "default:dirt_with_grass"} end
if minetest.get_modpath("ethereal") and not mobs.custom_spawn_animal then
mobs:spawn({
name = ":mobs_animal:panda",
nodes = spawn_on,
neighbors = {"group:grass"},
min_light = 14,
interval = 60,
chance = 4000,
min_height = 5,
max_height = 80,
day_toggle = true
})
end
mobs:register_egg(":mobs_animal:panda", S("Panda"), "mobs_panda_inv.png")