code tidy

This commit is contained in:
tenplus1
2022-09-27 09:15:59 +01:00
parent 840291ee5b
commit be80ec3269
12 changed files with 260 additions and 208 deletions

View File

@ -1,6 +1,7 @@
local S = mobs.intllib_animal
-- Panda by AspireMint (CC BY-SA 3.0)
mobs:register_mob("mobs_animal:panda", {
@ -20,12 +21,12 @@ stepheight = 0.6,
visual = "mesh",
mesh = "mobs_panda.b3d",
textures = {
{"mobs_panda.png"},
{"mobs_panda.png"}
},
makes_footstep_sound = true,
sounds = {
random = "mobs_panda",
attack = "mobs_panda",
attack = "mobs_panda"
},
walk_chance = 5,
walk_velocity = 0.5,
@ -35,7 +36,7 @@ stepheight = 0.6,
follow = {"ethereal:bamboo", "bamboo:trunk"},
view_range = 8,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 2},
{name = "mobs:meat_raw", chance = 1, min = 1, max = 2}
},
water_damage = 0,
lava_damage = 5,
@ -59,14 +60,16 @@ stepheight = 0.6,
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,
end
})
if minetest.get_modpath("ethereal") and not mobs.custom_spawn_animal then
mobs:spawn({
@ -75,11 +78,12 @@ if minetest.get_modpath("ethereal") and not mobs.custom_spawn_animal then
neighbors = {"group:grass"},
min_light = 14,
interval = 60,
chance = 8000, -- 15000
chance = 8000,
min_height = 10,
max_height = 80,
day_toggle = true,
day_toggle = true
})
end
mobs:register_egg("mobs_animal:panda", S("Panda"), "mobs_panda_inv.png")