2017-05-25 20:39:12 -04:00
|
|
|
--MCmobs v0.4
|
2017-05-22 22:27:00 -04:00
|
|
|
--maikerumine
|
|
|
|
--made for MC like Survival game
|
|
|
|
--License for code WTFPL and otherwise stated in readmes
|
|
|
|
|
|
|
|
|
|
|
|
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
2017-05-25 20:39:12 -04:00
|
|
|
|
|
|
|
|
2017-05-22 22:27:00 -04:00
|
|
|
--###################
|
|
|
|
--################### PARROT
|
|
|
|
--###################
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-23 19:03:37 -04:00
|
|
|
mobs:register_mob("mobs_mc:parrot", {
|
|
|
|
type = "npc",
|
2017-05-22 22:27:00 -04:00
|
|
|
pathfinding = true,
|
2017-06-14 19:47:33 -04:00
|
|
|
hp_min = 6,
|
|
|
|
hp_max = 6,
|
|
|
|
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.6, 0.25},
|
2017-05-23 19:03:37 -04:00
|
|
|
rotate = -180,
|
|
|
|
visual = "mesh",
|
2017-06-27 00:32:05 +02:00
|
|
|
mesh = "mobs_mc_parrot.b3d",
|
2017-05-23 19:03:37 -04:00
|
|
|
textures = {{"parrot_blue.png"},{"parrot_green.png"},{"parrot_grey.png"},{"parrot_red_blue.png"},{"parrot_yellow_blue.png"}},
|
|
|
|
visual_size = {x=3, y=3},
|
2017-05-22 22:27:00 -04:00
|
|
|
makes_footstep_sound = true,
|
|
|
|
sounds = {
|
2017-05-23 19:03:37 -04:00
|
|
|
random = "Villagerdeny",
|
2017-05-22 22:27:00 -04:00
|
|
|
},
|
|
|
|
walk_velocity = .8,
|
|
|
|
run_velocity = 2.6,
|
|
|
|
drops = {
|
2017-06-23 18:26:00 +02:00
|
|
|
{name = mobs_mc.items.feather,
|
2017-05-28 23:16:44 -04:00
|
|
|
chance = 1,
|
|
|
|
min = 1,
|
|
|
|
max = 2,},
|
2017-05-22 22:27:00 -04:00
|
|
|
},
|
2017-05-23 19:03:37 -04:00
|
|
|
animation = {
|
|
|
|
speed_normal = 50,
|
|
|
|
speed_run = 50,
|
2017-05-22 22:27:00 -04:00
|
|
|
stand_start = 0,
|
2017-05-23 19:03:37 -04:00
|
|
|
stand_end = 0,
|
|
|
|
walk_start = 0,
|
|
|
|
walk_end = 130,
|
|
|
|
--run_start = 0,
|
|
|
|
--run_end = 20,
|
|
|
|
--fly_start = 30,
|
|
|
|
--fly_end = 45,
|
2017-05-22 22:27:00 -04:00
|
|
|
},
|
|
|
|
drawtype = "front",
|
|
|
|
water_damage = 10,
|
2017-05-25 20:39:12 -04:00
|
|
|
lava_damage = 2,
|
2017-05-22 22:27:00 -04:00
|
|
|
light_damage = 0,
|
|
|
|
fall_damage = 0,
|
|
|
|
view_range = 16,
|
2017-05-23 19:03:37 -04:00
|
|
|
attack_type = "dogfight",
|
|
|
|
attacks_monsters = true,
|
2017-05-22 22:27:00 -04:00
|
|
|
jump = true,
|
|
|
|
jump_height = 4,
|
2017-06-14 19:47:33 -04:00
|
|
|
stepheight = 1.2,
|
2017-05-22 22:27:00 -04:00
|
|
|
floats=1,
|
2017-06-14 19:47:33 -04:00
|
|
|
physical = true,
|
2017-05-22 22:27:00 -04:00
|
|
|
fly = true,
|
2017-06-23 18:26:00 +02:00
|
|
|
fly_in = {"air"},
|
2017-05-22 22:27:00 -04:00
|
|
|
jump_chance = 98,
|
|
|
|
fear_height = 120,
|
2017-05-23 19:03:37 -04:00
|
|
|
view_range = 25,
|
2017-05-22 22:27:00 -04:00
|
|
|
|
2017-05-23 19:03:37 -04:00
|
|
|
on_rightclick = function(self, clicker)
|
2017-05-22 22:27:00 -04:00
|
|
|
|
2017-05-23 19:03:37 -04:00
|
|
|
if mobs:feed_tame(self, clicker, 8, true, true) then
|
|
|
|
return
|
|
|
|
end
|
2017-05-22 22:27:00 -04:00
|
|
|
|
2017-05-23 19:03:37 -04:00
|
|
|
mobs:capture_mob(self, clicker, 30, 50, 80, false, nil)
|
2017-05-22 22:27:00 -04:00
|
|
|
end,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2017-05-25 20:39:12 -04:00
|
|
|
--spawn
|
2017-06-24 19:09:38 +02:00
|
|
|
-- TODO: Increase spawn chance if polished
|
|
|
|
mobs:spawn_specific("mobs_mc:parrot", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX+1, 20, 20000, 2, 15, 20)
|
2017-05-23 19:03:37 -04:00
|
|
|
|
|
|
|
-- spawn eggs
|
|
|
|
mobs:register_egg("mobs_mc:parrot", "Parrot", "parrot_inv.png", 0)
|
2017-05-22 22:27:00 -04:00
|
|
|
|
2017-06-21 00:20:06 -04:00
|
|
|
if minetest.settings:get_bool("log_mods") then
|
2017-05-23 19:03:37 -04:00
|
|
|
minetest.log("action", "MC Parrot loaded")
|
2017-06-14 19:47:33 -04:00
|
|
|
end
|