2017-07-05 01:15:46 +00:00
|
|
|
--MCmobs v0.4
|
|
|
|
--maikerumine
|
|
|
|
--made for MC like Survival game
|
|
|
|
--License for code WTFPL and otherwise stated in readmes
|
|
|
|
|
2019-03-07 19:43:39 +00:00
|
|
|
local S = minetest.get_translator("mobs_mc")
|
2019-12-09 08:56:38 +00:00
|
|
|
local mod_bows = minetest.get_modpath("mcl_bows") ~= nil
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
mobs:register_mob("mobs_mc:illusioner", {
|
|
|
|
type = "monster",
|
2020-04-11 00:46:03 +00:00
|
|
|
spawn_class = "hostile",
|
2021-04-19 01:02:03 +00:00
|
|
|
attack_type = "projectile",
|
2019-12-09 08:56:38 +00:00
|
|
|
shoot_interval = 2.5,
|
2017-07-05 01:15:46 +00:00
|
|
|
shoot_offset = 1.5,
|
2019-12-09 08:29:19 +00:00
|
|
|
arrow = "mcl_bows:arrow_entity",
|
|
|
|
shoot_arrow = function(self, pos, dir)
|
2019-12-09 08:56:38 +00:00
|
|
|
if mod_bows then
|
|
|
|
-- 1-4 damage per arrow
|
|
|
|
local dmg = math.random(1, 4)
|
2021-04-23 18:10:12 +00:00
|
|
|
mobs.shoot_projectile_handling("mcl_bows:arrow", pos, dir, self.object:get_yaw(), self.object, nil, dmg)
|
2019-12-09 08:56:38 +00:00
|
|
|
end
|
2019-12-09 08:29:19 +00:00
|
|
|
end,
|
2017-07-05 01:15:46 +00:00
|
|
|
hp_min = 32,
|
|
|
|
hp_max = 32,
|
2020-12-06 14:46:42 +00:00
|
|
|
xp_min = 6,
|
|
|
|
xp_max = 6,
|
2017-07-05 01:15:46 +00:00
|
|
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
|
|
|
visual = "mesh",
|
|
|
|
mesh = "mobs_mc_illusioner.b3d",
|
2017-09-13 21:13:47 +00:00
|
|
|
textures = { {
|
|
|
|
"mobs_mc_illusionist.png",
|
|
|
|
"mobs_mc_illusionist.png", --hat
|
2018-05-07 21:10:49 +00:00
|
|
|
"mcl_bows_bow.png",
|
2017-09-13 21:13:47 +00:00
|
|
|
}, },
|
2018-09-14 14:05:47 +00:00
|
|
|
sounds = {
|
|
|
|
-- TODO: more sounds
|
|
|
|
distance = 16,
|
|
|
|
},
|
2021-03-19 13:32:02 +00:00
|
|
|
visual_size = {x=2.75, y=2.75},
|
2017-07-05 01:15:46 +00:00
|
|
|
walk_velocity = 0.6,
|
|
|
|
run_velocity = 2,
|
|
|
|
jump = true,
|
|
|
|
animation = {
|
2018-05-30 15:34:38 +00:00
|
|
|
stand_speed = 25,
|
2017-07-05 01:15:46 +00:00
|
|
|
stand_start = 40,
|
|
|
|
stand_end = 59,
|
2018-05-30 15:34:38 +00:00
|
|
|
walk_speed = 25,
|
2017-07-05 01:15:46 +00:00
|
|
|
walk_start = 0,
|
|
|
|
walk_end = 40,
|
2018-05-30 15:34:38 +00:00
|
|
|
run_speed = 25,
|
2017-09-13 21:13:47 +00:00
|
|
|
shoot_start = 150,
|
|
|
|
shoot_end = 170,
|
2018-05-30 15:34:38 +00:00
|
|
|
die_speed = 15,
|
|
|
|
die_start = 170,
|
|
|
|
die_end = 180,
|
|
|
|
die_loop = false,
|
2017-09-13 21:13:47 +00:00
|
|
|
-- 120-140 magic arm swinging, 140-150 transition between magic to bow shooting
|
2017-07-05 01:15:46 +00:00
|
|
|
},
|
|
|
|
view_range = 16,
|
|
|
|
fear_height = 4,
|
|
|
|
})
|
|
|
|
|
|
|
|
mobs:register_egg("mobs_mc:illusioner", S("Illusioner"), "mobs_mc_spawn_icon_illusioner.png", 0)
|