update
parent
9c948e7788
commit
39bc4b7ca3
2
bee.lua
2
bee.lua
|
@ -9,7 +9,7 @@ mobs:register_mob("mobs_animal:bee", {
|
||||||
hp_min = 1,
|
hp_min = 1,
|
||||||
hp_max = 2,
|
hp_max = 2,
|
||||||
armor = 200,
|
armor = 200,
|
||||||
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.2, 0.2},
|
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.5, 0.2},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_bee.x",
|
mesh = "mobs_bee.x",
|
||||||
textures = {
|
textures = {
|
||||||
|
|
|
@ -28,7 +28,7 @@ mobs:register_mob("mobs_animal:bunny", {
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
|
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
|
||||||
},
|
},
|
||||||
water_damage = 1,
|
water_damage = 2,
|
||||||
lava_damage = 4,
|
lava_damage = 4,
|
||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
fear_height = 2,
|
fear_height = 2,
|
||||||
|
@ -49,9 +49,9 @@ mobs:register_mob("mobs_animal:bunny", {
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
|
|
||||||
-- feed or tame
|
-- feed or tame
|
||||||
if mobs:feed_tame(self, clicker, 4, true, true) then
|
if mobs:feed_tame(self, clicker, 4, true, true) then return end
|
||||||
return
|
if mobs:protect(self, clicker) then return end
|
||||||
end
|
if mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) then return end
|
||||||
|
|
||||||
-- Monty Python tribute
|
-- Monty Python tribute
|
||||||
local item = clicker:get_wielded_item()
|
local item = clicker:get_wielded_item()
|
||||||
|
@ -73,7 +73,6 @@ mobs:register_mob("mobs_animal:bunny", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
mobs:capture_mob(self, clicker, 30, 50, 80, false, nil)
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
attack_type = "dogfight",
|
attack_type = "dogfight",
|
||||||
|
|
54
chicken.lua
54
chicken.lua
|
@ -34,7 +34,7 @@ mobs:register_mob("mobs_animal:chicken", {
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:chicken_raw", chance = 1, min = 2, max = 2},
|
{name = "mobs:chicken_raw", chance = 1, min = 2, max = 2},
|
||||||
},
|
},
|
||||||
water_damage = 1,
|
water_damage = 2,
|
||||||
lava_damage = 5,
|
lava_damage = 5,
|
||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
fall_damage = 0,
|
fall_damage = 0,
|
||||||
|
@ -52,18 +52,21 @@ mobs:register_mob("mobs_animal:chicken", {
|
||||||
|
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
|
|
||||||
if mobs:feed_tame(self, clicker, 8, true, true) then
|
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||||
return
|
if mobs:protect(self, clicker) then return end
|
||||||
end
|
if mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) then return end
|
||||||
|
|
||||||
mobs:protect(self, clicker)
|
|
||||||
mobs:capture_mob(self, clicker, 30, 50, 80, false, nil)
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
do_custom = function(self)
|
do_custom = function(self, dtime)
|
||||||
|
|
||||||
|
self.egg_timer = (self.egg_timer or 0) + dtime
|
||||||
|
if self.egg_timer < 10 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self.egg_timer = 0
|
||||||
|
|
||||||
if self.child
|
if self.child
|
||||||
or math.random(1, 5000) > 1 then
|
or math.random(1, 100) > 1 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -105,14 +108,14 @@ mobs:register_arrow("mobs_animal:egg_entity", {
|
||||||
velocity = 6,
|
velocity = 6,
|
||||||
|
|
||||||
hit_player = function(self, player)
|
hit_player = function(self, player)
|
||||||
player:punch(self.object, 1.0, {
|
player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
|
||||||
full_punch_interval = 1.0,
|
full_punch_interval = 1.0,
|
||||||
damage_groups = {fleshy = 1},
|
damage_groups = {fleshy = 1},
|
||||||
}, nil)
|
}, nil)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
hit_mob = function(self, player)
|
hit_mob = function(self, player)
|
||||||
player:punch(self.object, 1.0, {
|
player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
|
||||||
full_punch_interval = 1.0,
|
full_punch_interval = 1.0,
|
||||||
damage_groups = {fleshy = 1},
|
damage_groups = {fleshy = 1},
|
||||||
}, nil)
|
}, nil)
|
||||||
|
@ -120,23 +123,23 @@ mobs:register_arrow("mobs_animal:egg_entity", {
|
||||||
|
|
||||||
hit_node = function(self, pos, node)
|
hit_node = function(self, pos, node)
|
||||||
|
|
||||||
local num = math.random(1, 10)
|
if math.random(1, 10) > 1 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
pos.y = pos.y + 1
|
||||||
|
|
||||||
if num == 1 then
|
local nod = minetest.get_node_or_nil(pos)
|
||||||
|
|
||||||
pos.y = pos.y + 1
|
if not nod
|
||||||
|
or not minetest.registered_nodes[nod.name]
|
||||||
|
or minetest.registered_nodes[nod.name].walkable == true then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local nod = minetest.get_node_or_nil(pos)
|
local mob = minetest.add_entity(pos, "mobs_animal:chicken")
|
||||||
|
|
||||||
if not nod
|
|
||||||
or not minetest.registered_nodes[nod.name]
|
|
||||||
or minetest.registered_nodes[nod.name].walkable == true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local mob = minetest.add_entity(pos, "mobs_animal:chicken")
|
|
||||||
local ent2 = mob:get_luaentity()
|
local ent2 = mob:get_luaentity()
|
||||||
|
|
||||||
mob:set_properties({
|
mob:set_properties({
|
||||||
textures = ent2.child_texture[1],
|
textures = ent2.child_texture[1],
|
||||||
visual_size = {
|
visual_size = {
|
||||||
|
@ -152,11 +155,10 @@ mobs:register_arrow("mobs_animal:egg_entity", {
|
||||||
ent2.base_colbox[6] / 2
|
ent2.base_colbox[6] / 2
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
ent2.child = true
|
ent2.child = true
|
||||||
ent2.tamed = true
|
ent2.tamed = true
|
||||||
ent2.owner = self.playername
|
ent2.owner = self.playername
|
||||||
end
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
19
cow.lua
19
cow.lua
|
@ -30,7 +30,8 @@ mobs:register_mob("mobs_animal:cow", {
|
||||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
||||||
-- {name = "mobs:leather", chance = 1, min = 1, max = 2},
|
-- {name = "mobs:leather", chance = 1, min = 1, max = 2},
|
||||||
},
|
},
|
||||||
water_damage = 1,
|
water_damage = 2,
|
||||||
|
floats = 0,
|
||||||
lava_damage = 5,
|
lava_damage = 5,
|
||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
animation = {
|
animation = {
|
||||||
|
@ -46,17 +47,21 @@ mobs:register_mob("mobs_animal:cow", {
|
||||||
punch_end = 100,
|
punch_end = 100,
|
||||||
},
|
},
|
||||||
follow = "farming:wheat",
|
follow = "farming:wheat",
|
||||||
view_range = 7,
|
view_range = 8,
|
||||||
|
owner_loyal = true,
|
||||||
replace_rate = 10,
|
replace_rate = 10,
|
||||||
replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"},
|
replace_what = {
|
||||||
|
{"group:grass", "air", 0},
|
||||||
|
{"default:dirt_with_grass", "default:dirt", -1}
|
||||||
|
},
|
||||||
replace_with = "air",
|
replace_with = "air",
|
||||||
fear_height = 2,
|
fear_height = 2,
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
|
|
||||||
-- feed or tame
|
-- feed or tame
|
||||||
if mobs:feed_tame(self, clicker, 8, true, true) then
|
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||||
return
|
if mobs:protect(self, clicker) then return end
|
||||||
end
|
if mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) then return end
|
||||||
|
|
||||||
local tool = clicker:get_wielded_item()
|
local tool = clicker:get_wielded_item()
|
||||||
local name = clicker:get_player_name()
|
local name = clicker:get_player_name()
|
||||||
|
@ -92,8 +97,6 @@ mobs:register_mob("mobs_animal:cow", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
mobs:protect(self, clicker)
|
|
||||||
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
11
init.lua
11
init.lua
|
@ -3,8 +3,14 @@ local path = minetest.get_modpath("mobs_animal")
|
||||||
|
|
||||||
-- Intllib
|
-- Intllib
|
||||||
local S
|
local S
|
||||||
if minetest.get_modpath("intllib") then
|
if minetest.global_exists("intllib") then
|
||||||
S = intllib.Getter()
|
if intllib.make_gettext_pair then
|
||||||
|
-- New method using gettext.
|
||||||
|
S = intllib.make_gettext_pair()
|
||||||
|
else
|
||||||
|
-- Old method using text files.
|
||||||
|
S = intllib.Getter()
|
||||||
|
end
|
||||||
else
|
else
|
||||||
S = function(s) return s end
|
S = function(s) return s end
|
||||||
end
|
end
|
||||||
|
@ -20,5 +26,6 @@ dofile(path .. "/warthog.lua") -- KrupnoPavel
|
||||||
dofile(path .. "/bee.lua") -- KrupnoPavel
|
dofile(path .. "/bee.lua") -- KrupnoPavel
|
||||||
-- dofile(path .. "/bunny.lua") -- ExeterDad
|
-- dofile(path .. "/bunny.lua") -- ExeterDad
|
||||||
-- dofile(path .. "/kitten.lua") -- Jordach/BFD
|
-- dofile(path .. "/kitten.lua") -- Jordach/BFD
|
||||||
|
-- dofile(path .. "/penguin.lua") -- D00Med
|
||||||
|
|
||||||
print (S("[MOD] Mobs Redo 'Animals' loaded"))
|
print (S("[MOD] Mobs Redo 'Animals' loaded"))
|
||||||
|
|
10
kitten.lua
10
kitten.lua
|
@ -30,7 +30,7 @@ mobs:register_mob("mobs_animal:kitten", {
|
||||||
drops = {
|
drops = {
|
||||||
{name = "farming:string", chance = 1, min = 1, max = 1},
|
{name = "farming:string", chance = 1, min = 1, max = 1},
|
||||||
},
|
},
|
||||||
water_damage = 1,
|
water_damage = 2,
|
||||||
lava_damage = 5,
|
lava_damage = 5,
|
||||||
fear_height = 3,
|
fear_height = 3,
|
||||||
animation = {
|
animation = {
|
||||||
|
@ -44,11 +44,9 @@ mobs:register_mob("mobs_animal:kitten", {
|
||||||
view_range = 8,
|
view_range = 8,
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
|
|
||||||
if mobs:feed_tame(self, clicker, 4, true, true) then
|
if mobs:feed_tame(self, clicker, 4, true, true) then return end
|
||||||
return
|
if mobs:protect(self, clicker) then return end
|
||||||
end
|
if mobs:capture_mob(self, clicker, 50, 50, 90, false, nil) then return end
|
||||||
|
|
||||||
mobs:capture_mob(self, clicker, 50, 50, 90, false, nil)
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
|
||||||
|
local S = mobs.intllib
|
||||||
|
|
||||||
|
|
||||||
|
-- Penguin by D00Med
|
||||||
|
|
||||||
|
mobs:register_mob("mobs_animal:penguin", {
|
||||||
|
type = "animal",
|
||||||
|
passive = true,
|
||||||
|
reach = 1,
|
||||||
|
hp_min = 5,
|
||||||
|
hp_max = 10,
|
||||||
|
armor = 200,
|
||||||
|
collisionbox = {-0.2, -0.0, -0.2, 0.2, 0.5, 0.2},
|
||||||
|
visual = "mesh",
|
||||||
|
mesh = "mobs_penguin.b3d",
|
||||||
|
visual_size = {x = 0.25, y = 0.25},
|
||||||
|
textures = {
|
||||||
|
{"mobs_penguin.png"},
|
||||||
|
},
|
||||||
|
sounds = {},
|
||||||
|
makes_footstep_sound = true,
|
||||||
|
walk_velocity = 1,
|
||||||
|
run_velocity = 2,
|
||||||
|
runaway = true,
|
||||||
|
jump = false,
|
||||||
|
stepheight = 1.1,
|
||||||
|
drops = {
|
||||||
|
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
|
||||||
|
},
|
||||||
|
water_damage = 0,
|
||||||
|
lava_damage = 4,
|
||||||
|
light_damage = 0,
|
||||||
|
fear_height = 2,
|
||||||
|
animation = {
|
||||||
|
speed_normal = 15,
|
||||||
|
stand_start = 1,
|
||||||
|
stand_end = 20,
|
||||||
|
walk_start = 25,
|
||||||
|
walk_end = 45,
|
||||||
|
fly_start = 75, -- swim animation
|
||||||
|
fly_end = 95,
|
||||||
|
-- 50-70 is slide/water idle
|
||||||
|
},
|
||||||
|
fly_in = "default:water_source",
|
||||||
|
floats = 0,
|
||||||
|
follow = {"ethereal:fish_raw"},
|
||||||
|
view_range = 5,
|
||||||
|
|
||||||
|
on_rightclick = function(self, clicker)
|
||||||
|
|
||||||
|
-- feed or tame
|
||||||
|
if mobs:feed_tame(self, clicker, 4, false, true) then return end
|
||||||
|
if mobs:protect(self, clicker) then return end
|
||||||
|
if mobs:capture_mob(self, clicker, 5, 50, 80, false, nil) then return end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
mobs:spawn({
|
||||||
|
name = "mobs_animal:penguin",
|
||||||
|
nodes = {"default:snowblock"},
|
||||||
|
min_light = 10,
|
||||||
|
chance = 20000,
|
||||||
|
min_height = 0,
|
||||||
|
day_toggle = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
mobs:register_egg("mobs_animal:penguin", S("Penguin"), "default_snow.png", 1)
|
|
@ -49,7 +49,7 @@ for _, col in pairs(all_colours) do
|
||||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 2},
|
{name = "mobs:meat_raw", chance = 1, min = 1, max = 2},
|
||||||
--{name = "wool:"..col[1], chance = 1, min = 1, max = 1},
|
--{name = "wool:"..col[1], chance = 1, min = 1, max = 1},
|
||||||
},
|
},
|
||||||
water_damage = 1,
|
water_damage = 2,
|
||||||
lava_damage = 5,
|
lava_damage = 5,
|
||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
animation = {
|
animation = {
|
||||||
|
@ -165,10 +165,10 @@ for _, col in pairs(all_colours) do
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- protect mod with mobs:protector item
|
-- protect mod with mobs:protector item
|
||||||
mobs:protect(self, clicker)
|
if mobs:protect(self, clicker) then return end
|
||||||
|
|
||||||
--are we capturing?
|
--are we capturing?
|
||||||
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
|
if mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) then return end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
11
warthog.lua
11
warthog.lua
|
@ -32,7 +32,7 @@ mobs:register_mob("mobs_animal:pumba", {
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:pork_raw", chance = 1, min = 1, max = 3},
|
{name = "mobs:pork_raw", chance = 1, min = 1, max = 3},
|
||||||
},
|
},
|
||||||
water_damage = 1,
|
water_damage = 2,
|
||||||
lava_damage = 5,
|
lava_damage = 5,
|
||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
fear_height = 2,
|
fear_height = 2,
|
||||||
|
@ -47,12 +47,9 @@ mobs:register_mob("mobs_animal:pumba", {
|
||||||
},
|
},
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
|
|
||||||
if mobs:feed_tame(self, clicker, 8, true, true) then
|
if mobs:feed_tame(self, clicker, 8, true, true) then return end
|
||||||
return
|
if mobs:protect(self, clicker) then return end
|
||||||
end
|
if mobs:capture_mob(self, clicker, 0, 5, 50, false, nil) then return end
|
||||||
|
|
||||||
mobs:protect(self, clicker)
|
|
||||||
mobs:capture_mob(self, clicker, 0, 5, 50, false, nil)
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue