1
0
Fork 0

Immobilize shulkers

This commit is contained in:
cora 2022-09-11 19:17:55 +02:00
parent fd26d4f9c7
commit 4880436625
2 changed files with 25 additions and 5 deletions

View File

@ -303,10 +303,13 @@ end
-- set and return valid yaw -- set and return valid yaw
local set_yaw = function(self, yaw, delay, dtime) local set_yaw = function(self, yaw, delay, dtime)
if self.noyaw then return end
if true then if true then
self.object:set_yaw(yaw) self.object:set_yaw(yaw)
return yaw return yaw
end end
if not yaw or yaw ~= yaw then if not yaw or yaw ~= yaw then
yaw = 0 yaw = 0
end end
@ -4069,6 +4072,7 @@ minetest.register_entity(name, {
ignited_by_sunlight = def.ignited_by_sunlight or false, ignited_by_sunlight = def.ignited_by_sunlight or false,
spawn_in_group = def.spawn_in_group, spawn_in_group = def.spawn_in_group,
spawn_in_group_min = def.spawn_in_group_min, spawn_in_group_min = def.spawn_in_group_min,
noyaw = def.noyaw or false,
-- End of MCL2 extensions -- End of MCL2 extensions
on_spawn = def.on_spawn, on_spawn = def.on_spawn,

View File

@ -44,15 +44,31 @@ mcl_mobs:register_mob("mobs_mc:shulker", {
looting_factor = 0.0625}, looting_factor = 0.0625},
}, },
animation = { animation = {
stand_speed = 25, walk_speed = 25, run_speed = 50, punch_speed = 25, stand_speed = 25, walk_speed = 0, run_speed = 50, punch_speed = 25,
speed_normal = 25, speed_run = 50, speed_normal = 25, speed_run = 50,
stand_start = 0, stand_end = 45, stand_start = 0, stand_end = 25,
walk_start = 0, walk_end = 45, walk_start = 25, walk_end = 45,
run_start = 0, run_end = 45, run_start = 45, run_end = 85,
punch_start = 80, punch_end = 100, punch_start = 80, punch_end = 100,
}, },
view_range = 16, view_range = 16,
fear_height = 4, 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,
}) })
-- bullet arrow (weapon) -- bullet arrow (weapon)