2017-07-05 04:15:46 +03:00
|
|
|
--MCmobs v0.2
|
|
|
|
--maikerumine
|
|
|
|
--made for MC like Survival game
|
|
|
|
--License for code WTFPL and otherwise stated in readmes
|
|
|
|
|
2022-02-13 22:40:12 +02:00
|
|
|
local S = minetest.get_translator("mobs_mc")
|
2017-07-05 04:15:46 +03:00
|
|
|
|
|
|
|
--###################
|
|
|
|
--################### SHULKER
|
|
|
|
--###################
|
|
|
|
|
|
|
|
-- animation 45-80 is transition between passive and attack stance
|
2021-04-25 18:30:15 +03:00
|
|
|
|
2022-05-25 15:44:49 +03:00
|
|
|
mcl_mobs:register_mob("mobs_mc:shulker", {
|
2021-04-25 18:30:15 +03:00
|
|
|
description = S("Shulker"),
|
2017-07-05 04:15:46 +03:00
|
|
|
type = "monster",
|
2020-04-11 03:46:03 +03:00
|
|
|
spawn_class = "hostile",
|
2022-02-13 22:40:12 +02:00
|
|
|
attack_type = "shoot",
|
2017-07-05 04:15:46 +03:00
|
|
|
shoot_interval = 0.5,
|
|
|
|
arrow = "mobs_mc:shulkerbullet",
|
|
|
|
shoot_offset = 0.5,
|
|
|
|
passive = false,
|
|
|
|
hp_min = 30,
|
|
|
|
hp_max = 30,
|
2020-12-06 16:46:42 +02:00
|
|
|
xp_min = 5,
|
|
|
|
xp_max = 5,
|
2017-07-05 04:15:46 +03:00
|
|
|
armor = 150,
|
|
|
|
collisionbox = {-0.5, -0.01, -0.5, 0.5, 0.99, 0.5},
|
|
|
|
visual = "mesh",
|
|
|
|
mesh = "mobs_mc_shulker.b3d",
|
|
|
|
textures = { "mobs_mc_endergolem.png", },
|
2018-09-14 17:27:58 +03:00
|
|
|
-- TODO: sounds
|
2017-07-05 04:15:46 +03:00
|
|
|
-- TODO: Make shulker dye-able
|
|
|
|
visual_size = {x=3, y=3},
|
|
|
|
walk_chance = 0,
|
2022-06-07 10:55:19 +03:00
|
|
|
knock_back = false,
|
2017-07-05 04:15:46 +03:00
|
|
|
jump = false,
|
|
|
|
drops = {
|
2022-05-26 00:25:15 +03:00
|
|
|
{name = "mcl_mobitems:shulker_shell",
|
2020-12-23 18:41:42 +02:00
|
|
|
chance = 2,
|
|
|
|
min = 1,
|
|
|
|
max = 1,
|
|
|
|
looting = "rare",
|
|
|
|
looting_factor = 0.0625},
|
2017-07-05 04:15:46 +03:00
|
|
|
},
|
|
|
|
animation = {
|
2022-09-11 20:17:55 +03:00
|
|
|
stand_speed = 25, walk_speed = 0, run_speed = 50, punch_speed = 25,
|
2017-07-05 04:15:46 +03:00
|
|
|
speed_normal = 25, speed_run = 50,
|
2022-09-11 20:17:55 +03:00
|
|
|
stand_start = 0, stand_end = 25,
|
|
|
|
walk_start = 25, walk_end = 45,
|
|
|
|
run_start = 45, run_end = 85,
|
2017-07-05 04:15:46 +03:00
|
|
|
punch_start = 80, punch_end = 100,
|
|
|
|
},
|
|
|
|
view_range = 16,
|
2022-09-11 20:17:55 +03:00
|
|
|
fear_height = 0,
|
|
|
|
noyaw = true,
|
|
|
|
do_custom = function(self,dtime)
|
|
|
|
if math.floor(self.object:get_yaw()) ~=0 then
|
|
|
|
self.object:set_yaw(0)
|
|
|
|
mcl_mobs:yaw(self, 0, 0, dtime)
|
|
|
|
end
|
|
|
|
if self.state == "walk" or self.state == "stand" then
|
|
|
|
self.state = "stand"
|
|
|
|
mcl_mobs:set_animation(self, "stand")
|
|
|
|
end
|
|
|
|
if self.state == "attack" then
|
|
|
|
mcl_mobs:set_animation(self, "punch")
|
|
|
|
end
|
|
|
|
self.path.way = false
|
|
|
|
self.look_at_players = false
|
|
|
|
end,
|
2017-07-05 04:15:46 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
-- bullet arrow (weapon)
|
2022-05-25 15:44:49 +03:00
|
|
|
mcl_mobs:register_arrow("mobs_mc:shulkerbullet", {
|
2017-07-05 04:15:46 +03:00
|
|
|
visual = "sprite",
|
|
|
|
visual_size = {x = 0.25, y = 0.25},
|
|
|
|
textures = {"mobs_mc_shulkerbullet.png"},
|
|
|
|
velocity = 6,
|
|
|
|
|
|
|
|
hit_player = function(self, player)
|
|
|
|
player:punch(self.object, 1.0, {
|
|
|
|
full_punch_interval = 1.0,
|
|
|
|
damage_groups = {fleshy = 4},
|
|
|
|
}, nil)
|
|
|
|
end,
|
|
|
|
|
2019-03-11 14:25:06 +02:00
|
|
|
hit_mob = function(self, mob)
|
|
|
|
mob:punch(self.object, 1.0, {
|
2017-07-05 04:15:46 +03:00
|
|
|
full_punch_interval = 1.0,
|
|
|
|
damage_groups = {fleshy = 4},
|
|
|
|
}, nil)
|
|
|
|
end,
|
|
|
|
|
|
|
|
hit_node = function(self, pos, node)
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2022-05-25 15:44:49 +03:00
|
|
|
mcl_mobs:register_egg("mobs_mc:shulker", S("Shulker"), "mobs_mc_spawn_icon_shulker.png", 0)
|
2017-07-05 04:15:46 +03:00
|
|
|
|
2022-05-25 15:44:49 +03:00
|
|
|
mcl_mobs:spawn_specific(
|
2021-04-25 18:30:15 +03:00
|
|
|
"mobs_mc:shulker",
|
|
|
|
"end",
|
2021-04-08 14:39:18 +03:00
|
|
|
"ground",
|
|
|
|
{
|
|
|
|
"End"
|
|
|
|
},
|
2021-04-25 18:30:15 +03:00
|
|
|
0,
|
|
|
|
minetest.LIGHT_MAX+1,
|
|
|
|
30,
|
|
|
|
5000,
|
|
|
|
2,
|
2022-05-26 00:25:15 +03:00
|
|
|
mcl_vars.mg_end_min,
|
|
|
|
mcl_vars.mg_end_max)
|