-
Notifications
You must be signed in to change notification settings - Fork 8
/
mobs_animal.lua
105 lines (97 loc) · 2.39 KB
/
mobs_animal.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
local S = minetest.get_translator("mobs_animal")
-- viking panda with texture
mobs:register_mob("pandorabox_custom:panda_viking", {
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_viking.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 = {"bamboo:trunk"},
view_range = 8,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 2},
},
water_damage = 0,
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,
})
if minetest.get_modpath("bamboo") then
mobs:spawn({
name = "pandorabox_custom:panda_viking",
nodes = {"bamboo:trunk"},
neighbors = {"group:grass"},
min_light = 14,
interval = 60,
chance = 8000, -- 15000
min_height = 10,
max_height = 80,
day_toggle = true,
})
end
mobs:register_egg("pandorabox_custom:panda_viking", "Viking "..S("Panda"), "mobs_panda_inv.png")
-- Chicken customizations
minetest.register_craft({
type = "shapeless",
recipe = { "mobs_animal:chicken", "farming:cutting_board" },
output = "mobs:chicken_raw 2",
replacements = {
{ "farming:cutting_board", "farming:cutting_board" },
{ "mobs_animal:chicken", "mobs:chicken_feather" },
},
})
minetest.register_craft({
type = "shapeless",
recipe = { "mobs_animal:chicken_set", "farming:cutting_board" },
output = "mobs:chicken_raw 2",
replacements = {
{ "farming:cutting_board", "farming:cutting_board" },
{ "mobs_animal:chicken_set", "mobs:chicken_feather" },
},
})