2019-08-05 07:35:04 -07:00
|
|
|
mobs:register_mob('scorpion:pet', {
|
2019-09-07 12:19:21 -07:00
|
|
|
type = 'npc',
|
2019-08-05 07:35:04 -07:00
|
|
|
passive = false,
|
|
|
|
attack_type = 'dogfight',
|
|
|
|
owner_loyal = true,
|
2019-09-07 12:19:21 -07:00
|
|
|
pathfinding = true,
|
2019-08-05 07:35:04 -07:00
|
|
|
damage = 10,
|
|
|
|
hp_min = 30, hp_max = 75, armor = 45,
|
|
|
|
collisionbox = {-0.6, -0.35, -0.5, 0.6, 0.3, 0.5},
|
|
|
|
visual = 'mesh',
|
|
|
|
mesh = 'scorpion.b3d',
|
|
|
|
drawtype = 'front',
|
|
|
|
textures = {
|
2019-09-07 12:19:21 -07:00
|
|
|
{'scorpion_red.png^scorpion_pet.png'},
|
|
|
|
{'scorpion_green.png^scorpion_pet.png'},
|
|
|
|
{'scorpion_tan.png^scorpion_pet.png'},
|
2019-08-05 07:35:04 -07:00
|
|
|
},
|
|
|
|
blood_texture = 'mobs_blood.png',
|
2019-09-07 12:19:21 -07:00
|
|
|
visual_size = {x=8,y=8},
|
2019-08-05 07:35:04 -07:00
|
|
|
makes_footstep_sound = true,
|
|
|
|
sounds = {
|
|
|
|
war_cry = 'scorpion_squeak',
|
|
|
|
},
|
2019-09-07 12:19:21 -07:00
|
|
|
walk_velocity = 3,
|
2019-08-05 07:35:04 -07:00
|
|
|
run_velocity = 6,
|
|
|
|
jump = true,
|
|
|
|
stepheight = 1.7,
|
|
|
|
reach = 4,
|
2019-09-07 12:19:21 -07:00
|
|
|
view_range = 15,
|
2019-08-05 07:35:04 -07:00
|
|
|
fear_height = 2,
|
2019-09-07 12:19:21 -07:00
|
|
|
ower = '',
|
|
|
|
order = 'follow',
|
2019-08-05 07:35:04 -07:00
|
|
|
drops = {
|
|
|
|
{name = 'mobs:meat_raw', chance = 1, min = 2, max = 8},
|
|
|
|
},
|
2019-09-07 12:19:21 -07:00
|
|
|
water_damage = 1,
|
|
|
|
lava_damage = 6,
|
2019-08-05 07:35:04 -07:00
|
|
|
light_damage = 0,
|
|
|
|
animation = {
|
|
|
|
speed_normal = 45, speed_run = 90,
|
|
|
|
stand_start = 0, stand_end = 60,
|
|
|
|
walk_start = 150, walk_end = 210,
|
|
|
|
run_start = 150, run_end = 210,
|
|
|
|
punch_start = 220, punch_end = 260,
|
|
|
|
punch2_start = 265, punch2_end = 305,
|
|
|
|
punch3_start = 70, punch3_end = 140,
|
|
|
|
},
|
2019-09-07 12:19:21 -07:00
|
|
|
|
|
|
|
on_spawn = function(self)
|
|
|
|
local pos = self.object:get_pos()
|
|
|
|
local objs = minetest.get_objects_inside_radius(pos, 4)
|
|
|
|
for _, obj in pairs(objs) do
|
|
|
|
if obj:is_player() then
|
|
|
|
local owner = obj:get_player_name()
|
|
|
|
print ('owner name is '..owner)
|
|
|
|
self.owner = owner
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_rightclick = function(self, clicker)
|
|
|
|
local name = clicker:get_player_name()
|
|
|
|
if self.owner and self.owner == name then
|
|
|
|
if self.order == "follow" then
|
|
|
|
self.order = "stand"
|
|
|
|
minetest.chat_send_player(name, ("Scorpion holding ground."))
|
|
|
|
else
|
|
|
|
self.order = "follow"
|
|
|
|
minetest.chat_send_player(name, ("Scorpion following you."))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_grown = function(self)
|
|
|
|
print 'your pet grew up.'
|
|
|
|
end,
|
2019-08-05 07:35:04 -07:00
|
|
|
})
|
|
|
|
|
|
|
|
mobs:register_egg('scorpion:pet', 'Pet Scorpion', 'default_grass.png', 1)
|