1
0
mirror of https://codeberg.org/tenplus1/mobs_animal.git synced 2024-11-19 09:00:19 +01:00
mobs_animal/panda.lua

90 lines
1.8 KiB
Lua
Raw Normal View History

2018-07-06 20:13:46 +02:00
2022-01-20 09:55:41 +01:00
local S = mobs.intllib_animal
2018-07-06 20:13:46 +02:00
2022-09-27 10:15:59 +02:00
2018-07-06 20:13:46 +02:00
-- Panda by AspireMint (CC BY-SA 3.0)
mobs:register_mob("mobs_animal:panda", {
stepheight = 0.6,
type = "animal",
passive = false,
attack_type = "dogfight",
2018-07-06 22:39:32 +02:00
group_attack = false,
2018-07-06 20:13:46 +02:00
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 = {
2022-09-27 10:15:59 +02:00
{"mobs_panda.png"}
2018-07-06 20:13:46 +02:00
},
makes_footstep_sound = true,
sounds = {
random = "mobs_panda",
2022-09-27 10:15:59 +02:00
attack = "mobs_panda"
2018-07-06 20:13:46 +02:00
},
walk_chance = 5,
walk_velocity = 0.5,
run_velocity = 1.5,
2018-07-06 20:13:46 +02:00
jump = false,
jump_height = 6,
2019-09-07 09:56:52 +02:00
follow = {"ethereal:bamboo", "bamboo:trunk"},
2018-07-06 20:13:46 +02:00
view_range = 8,
drops = {
2022-09-27 10:15:59 +02:00
{name = "mobs:meat_raw", chance = 1, min = 1, max = 2}
2018-07-06 20:13:46 +02:00
},
water_damage = 0,
2018-07-06 20:13:46 +02:00
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,
2018-07-06 20:13:46 +02:00
walk_start = 10,
walk_end = 70,
run_start = 10,
run_end = 70,
2018-07-06 20:13:46 +02:00
punch_start = 80,
2018-07-07 10:30:50 +02:00
punch_end = 120,
2018-07-06 20:13:46 +02:00
-- 0 = rest, 1 = hiding (covers eyes), 2 = surprised
},
2022-09-27 10:15:59 +02:00
2018-07-06 20:13:46 +02:00
on_rightclick = function(self, clicker)
2018-07-13 21:58:16 +02:00
if mobs:feed_tame(self, clicker, 20, true, true) then return end
2018-07-06 20:13:46 +02:00
if mobs:protect(self, clicker) then return end
if mobs:capture_mob(self, clicker, 0, 5, 50, false, nil) then return end
2022-09-27 10:15:59 +02:00
end
2018-07-06 20:13:46 +02:00
})
2022-09-27 10:15:59 +02:00
if minetest.get_modpath("ethereal") and not mobs.custom_spawn_animal then
2018-07-06 20:13:46 +02:00
mobs:spawn({
2018-07-06 20:18:01 +02:00
name = "mobs_animal:panda",
2018-07-06 20:13:46 +02:00
nodes = {"ethereal:bamboo_dirt"},
neighbors = {"group:grass"},
min_light = 14,
interval = 60,
2022-09-27 10:15:59 +02:00
chance = 8000,
2018-07-06 20:13:46 +02:00
min_height = 10,
max_height = 80,
2022-09-27 10:15:59 +02:00
day_toggle = true
2018-07-06 20:13:46 +02:00
})
end
2022-09-27 10:15:59 +02:00
mobs:register_egg("mobs_animal:panda", S("Panda"), "mobs_panda_inv.png")