added some default drop items to mobs

This commit is contained in:
tenplus1 2021-08-13 09:35:53 +01:00
parent d44a25a6f4
commit b419af00d8
7 changed files with 54 additions and 7 deletions

View File

@ -26,6 +26,9 @@ mobs:register_mob("dmobs:elephant", {
fall_damage = 1,
fall_speed = -20, -- extra heavy!
fear_height = 2,
drops = {
{name = "default:grass_1", chance = 1, min = 1, max = 3},
},
replace_rate = 10,
replace_what = {
"default:grass_3", "default:grass_4", "default:grass_5", "ethereal:bamboo"

View File

@ -28,6 +28,10 @@ mobs:register_mob("dmobs:gnorm", {
fall_damage = 1,
fall_speed = -6,
fear_height = 4,
drops = {
{name = "default:wood", chance = 1, min = 1, max = 1},
{name = "default:apple", chance = 1, min = 0, max = 1},
},
replace_rate = 10,
replace_what = {
"default:apple", "default:stone", "default:stone_with_coal",

View File

@ -21,6 +21,7 @@ mobs:register_mob("dmobs:golem", {
run_velocity = 2.5,
jump = true,
drops = {
{name = "default:stone", chance = 1, min = 1, max = 5},
{name = "dmobs:golemstone", chance = 30, min = 1, max = 1},
},
water_damage = 0,

View File

@ -14,6 +14,9 @@ mobs:register_mob("dmobs:golem_friendly", {
{"dmobs_golem.png"},
},
follow = "default:cobble",
drops = {
{name = "default:cobble", chance = 1, min = 1, max = 3},
},
blood_texture = "default_stone.png",
visual_size = {x=1, y=1},
makes_footstep_sound = true,

View File

@ -26,6 +26,9 @@ mobs:register_mob("dmobs:hedgehog", {
fear_height = 4,
view_range = 14,
follow = {"farming:bread"},
drops = {
{name = "default:grass_1", chance = 1, min = 1, max = 3},
},
animation = {
speed_normal = 5,
speed_run = 10,

View File

@ -16,6 +16,9 @@ mobs:register_mob("dmobs:owl", {
walk_velocity = 0,
run_velocity = 0,
jump = false,
drops = {
{name = "default:dry_grass_1", chance = 1, min = 1, max = 1},
},
water_damage = 2,
lava_damage = 2,
fire_damage = 2,

View File

@ -11,10 +11,10 @@ mobs:register_mob("dmobs:tortoise", {
visual = "mesh",
mesh = "tortoise.b3d",
textures = {
{"dmobs_tortoise.png"},
{"dmobs_tortoise.png"}
},
blood_texture = "mobs_blood.png",
visual_size = {x=1, y=1},
visual_size = {x = 1, y = 1},
makes_footstep_sound = true,
walk_velocity = 0.5,
run_velocity = 1,
@ -22,7 +22,8 @@ mobs:register_mob("dmobs:tortoise", {
jump_height = 0.5,
floats = true,
drops = {
{name = "default:stick", chance = 1, min = 1, max = 1},
{name = "default:stick", chance = 2, min = 0, max = 1},
{name = "farming:string", chance = 2, min = 0, max = 1},
},
water_damage = 0,
lava_damage = 2,
@ -39,10 +40,11 @@ mobs:register_mob("dmobs:tortoise", {
walk_start = 23,
walk_end = 43,
stand_start = 1,
stand_end = 20,
stand_end = 1,
stand1_start = 1,
stand1_end = 20,
run_start = 23,
run_end = 43,
run_end = 43
},
on_rightclick = function(self, clicker)
@ -51,8 +53,36 @@ mobs:register_mob("dmobs:tortoise", {
return
end
mobs:capture_mob(self, clicker, 30, 50, 80, false, nil)
if self.state ~= "attack" then
self.state = "hide"
mobs:set_velocity(self, 0)
-- play inside shell animation
self.object:set_animation({x = 10, y = 10}, 6, 0)
minetest.after(5, function()
if self and self.object then
-- play coming out of shell animation
self.object:set_animation({x = 10, y = 20}, 6, 0)
self.state = "stand"
end
end)
end
mobs:capture_mob(self, clicker, 0, 50, 80, false, nil)
end,
do_custom = function(self, dtime)
if self.state == "hide" then
mobs:set_velocity(self, 0)
end
end
})