Add working system

This commit is contained in:
epCode 2024-06-02 15:57:04 -06:00
parent 70b6636568
commit eb39dcf605
12 changed files with 551 additions and 8 deletions

View file

@ -149,6 +149,16 @@ function mcl_mobs.register_mob(name, def)
head_yaw = def.head_yaw or "y", -- axis to rotate head on
horizontal_head_height = def.horizontal_head_height or 0,
wears_armor = def.wears_armor, -- a number value used to index texture slot for armor
-- use: armor_transforms = {arm_right = {"arm_right_bone_name", pos}}
-- or if you need rotation as well: armor_transforms = {arm_right = {"arm_right_bone_name", pos, rot}}
armor_transforms = def.armor_transforms or {
head = {"Head", vector.zero()},
chest = {"Body", vector.zero()},
arm_right = {"Arm_Right", vector.zero()},
arm_left = {"Arm_Left", vector.zero()},
leg_right = {"Leg_Left", vector.zero()},
leg_left = {"Leg_right", vector.zero()}
},
stepheight = def.stepheight or 0.6,
name = name,
description = def.description,

View file

@ -16,7 +16,7 @@ local function get_armor_texture(armor_name)
return "blank.png"
end
local seperator = string.find(armor_name, ":")
return "mcl_armor_"..string.sub(armor_name, seperator+1, -1)..".png^"
return "mcl_armor_"..string.sub(armor_name, seperator+1, -1)..".png"
end
--[[
@ -59,6 +59,70 @@ function mob_class:set_armor_texture()
end
]]
minetest.register_entity("mcl_mobs:armor_piece", {
visual = "mesh",
mesh = "mcl_mobs_armor_head.obj",
textures = {get_armor_texture("mcl_armor:helmet_diamond")},
_kill_on_detach = true,
_armor = true,
pointable = false,
physical = false,
collide_with_objects = false,
collisionbox = {0,0,0,0,0,0},
on_detach = function(self)
if self.object:get_pos() and not self.object:get_attach() and self._kill_on_detach then self.object:remove() return end
end,
on_activate = function(self)
minetest.after(0.2, function() -- if we are disconnected from anything unless made to, self destruct
if self and self.object and self.object:get_pos() then
if self.object:get_pos() and not self.object:get_attach() and self._kill_on_detach then self.object:remove() return end
end
end)
end,
}) -- specific piece selected at spawn
-- Adds a piece of armor (entity) into the worl based on it's name
function mcl_mobs.add_armor_piece(itemname, r_l, pos)
local obj = minetest.add_entity(pos or vector.zero(), "mcl_mobs:armor_piece") -- armor piece
tex = get_armor_texture(itemname) -- texture
local mesh = ""
-- choose correct model based on name
if string.find(itemname, "chestplate") then
if r_l then
if r_l == "r" then
mesh = "mcl_mobs_armor_arm_right.obj"
else
mesh = "mcl_mobs_armor_arm_left.obj"
end
else
mesh = "mcl_mobs_armor_chest.obj"
end
elseif string.find(itemname, "boots") or string.find(itemname, "leggings") then
if r_l then
if r_l == "r" then
mesh = "mcl_mobs_armor_leg_right.obj"
else
mesh = "mcl_mobs_armor_leg_left.obj"
end
end
elseif string.find(itemname, "helmet") then
mesh = "mcl_mobs_armor_head.obj"
end
obj:set_properties({textures = {tex}, mesh = mesh, visual_size = size or vector.new(1,1,1)})
return obj
end
--[[
minetest.register_globalstep(function(dtime)
for _,player in ipairs(minetest.get_connected_players()) do
mcl_mobs.add_armor_piece("mcl_armor:helmet_diamond", nil, player:get_pos())
end
end)]]
--new armor texture function
function mob_class:set_armor_texture()
if self.armor_list then
@ -67,17 +131,60 @@ function mob_class:set_armor_texture()
local leggings=minetest.registered_items[self.armor_list.leggings] or {name=""}
local helmet=minetest.registered_items[self.armor_list.helmet] or {name=""}
local no_armor
if helmet.name=="" and chestplate.name=="" and leggings.name=="" and boots.name=="" then
helmet={name="blank.png"}
no_armor = true
end
local texture = get_armor_texture(chestplate.name)..get_armor_texture(helmet.name)..get_armor_texture(boots.name)..get_armor_texture(leggings.name)
if string.sub(texture, -1,-1) == "^" then
texture=string.sub(texture,1,-2)
for _,obj in ipairs(self.object:get_children()) do --destroy old armor entities
if not obj:is_player() and obj:get_luaentity()._armor then
obj:set_detach()
end
if self.textures[self.wears_armor] then
self.textures[self.wears_armor]=texture
end
self.object:set_properties({textures=self.textures})
local tforms = self.armor_transforms
if chestplate.name ~= "" then
local armor_chest = mcl_mobs.add_armor_piece(chestplate.name, false)
local armor_right = mcl_mobs.add_armor_piece(chestplate.name, "r")
local armor_left = mcl_mobs.add_armor_piece(chestplate.name, "l")
armor_chest:set_properties({visual_size = self.armor_transforms.chest[4] or vector.new(1,1,1)})
armor_right:set_properties({visual_size = self.armor_transforms.arm_right[4] or vector.new(1,1,1)})
armor_left:set_properties({visual_size = self.armor_transforms.arm_left[4] or vector.new(1,1,1)})
armor_chest:set_attach(self.object, self.armor_transforms.chest[1], self.armor_transforms.chest[2], self.armor_transforms.chest[3] or vector.zero())
armor_right:set_attach(self.object, self.armor_transforms.arm_right[1], self.armor_transforms.arm_right[2], self.armor_transforms.arm_right[3] or vector.zero())
armor_left:set_attach(self.object, self.armor_transforms.arm_left[1], self.armor_transforms.arm_left[2], self.armor_transforms.arm_left[3] or vector.zero())
end
if leggings.name ~= "" then
local armor_right = mcl_mobs.add_armor_piece(leggings.name, "r")
local armor_left = mcl_mobs.add_armor_piece(leggings.name, "l")
armor_right:set_properties({visual_size = self.armor_transforms.leg_right[4] or vector.new(1,1,1)})
armor_left:set_properties({visual_size = self.armor_transforms.leg_left[4] or vector.new(1,1,1)})
armor_right:set_attach(self.object, self.armor_transforms.leg_right[1], self.armor_transforms.leg_right[2], self.armor_transforms.leg_right[3] or vector.zero())
armor_left:set_attach(self.object, self.armor_transforms.leg_left[1], self.armor_transforms.leg_left[2], self.armor_transforms.leg_left[3] or vector.zero())
end
if boots.name ~= "" then
local armor_right = mcl_mobs.add_armor_piece(boots.name, "r")
local armor_left = mcl_mobs.add_armor_piece(boots.name, "l")
armor_right:set_properties({visual_size = self.armor_transforms.leg_right[4] or vector.new(1,1,1)})
armor_left:set_properties({visual_size = self.armor_transforms.leg_left[4] or vector.new(1,1,1)})
armor_right:set_attach(self.object, self.armor_transforms.leg_right[1], self.armor_transforms.leg_right[2], self.armor_transforms.leg_right[3] or vector.zero())
armor_left:set_attach(self.object, self.armor_transforms.leg_left[1], self.armor_transforms.leg_left[2], self.armor_transforms.leg_left[3] or vector.zero())
end
if helmet.name ~= "" then
local armor_right = mcl_mobs.add_armor_piece(helmet.name, "r")
armor_right:set_properties({visual_size = self.armor_transforms.head[4] or vector.new(1,1,1)})
armor_right:set_attach(self.object, self.armor_transforms.head[1], self.armor_transforms.head[2], self.armor_transforms.head[3] or vector.zero())
end
local armor_
if type(self.armor) == "table" then

View file

@ -0,0 +1,37 @@
# Blender 4.0.2
# www.blender.org
o arm_left
v 1.248355 7.302495 1.300000
v -1.251645 0.002496 1.300000
v -1.251645 7.302495 -1.300000
v -1.251645 0.002496 -1.300000
v 1.248355 0.002496 -1.300000
v 1.248355 7.302495 -1.300000
v 1.248355 0.002496 1.300000
v -1.251645 7.302495 1.300000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vt 0.750000 0.375000
vt 0.812500 0.375000
vt 0.812500 0.500000
vt 0.750000 0.500000
vt 0.687500 0.375000
vt 0.687500 0.500000
vt 0.687500 0.000000
vt 0.625000 0.000000
vt 0.625000 0.375000
vt 0.750000 0.000000
vt 0.812500 0.000000
vt 0.875000 0.000000
vt 0.875000 0.375000
s 0
f 6/1/1 3/2/1 8/3/1 1/4/1
f 4/5/2 5/1/2 7/4/2 2/6/2
f 2/5/3 8/7/3 3/8/3 4/9/3
f 4/5/4 3/7/4 6/10/4 5/1/4
f 5/1/5 6/10/5 1/11/5 7/2/5
f 7/2/6 1/11/6 8/12/6 2/13/6

View file

@ -0,0 +1,37 @@
# Blender 4.0.2
# www.blender.org
o arm_right
v 1.249876 0.007618 -1.300000
v -1.250124 7.307617 -1.300000
v 1.249876 7.307617 -1.300000
v -1.250124 0.007618 1.300000
v -1.250124 7.307617 1.300000
v -1.250124 0.007618 -1.300000
v 1.249876 7.307617 1.300000
v 1.249876 0.007618 1.300000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn -0.0000 1.0000 -0.0000
vt 0.812500 0.375000
vt 0.875000 0.375000
vt 0.875000 0.000000
vt 0.812500 0.000000
vt 0.750000 0.375000
vt 0.750000 0.000000
vt 0.687500 0.375000
vt 0.687500 0.000000
vt 0.625000 0.375000
vt 0.625000 0.000000
vt 0.687500 0.500000
vt 0.750000 0.500000
vt 0.812500 0.500000
s 0
f 4/1/1 8/2/1 7/3/1 5/4/1
f 6/5/2 4/1/2 5/4/2 2/6/2
f 1/7/3 6/5/3 2/6/3 3/8/3
f 8/7/4 1/9/4 3/10/4 7/8/4
f 1/7/5 8/11/5 4/12/5 6/5/5
f 2/5/6 5/12/6 7/13/6 3/1/6

View file

@ -0,0 +1,152 @@
# Blender 4.0.2
# www.blender.org
o chest
v 2.200000 -0.001495 1.200000
v 2.200000 -0.001495 -1.200000
v 2.200000 7.098505 -1.200000
v -2.200000 7.098505 -1.200000
v -2.200000 7.098505 1.200000
v 2.200000 7.098505 1.200000
v -2.200000 -0.001495 -1.200000
v -2.200000 -0.001495 1.200000
v -4.168111 7.701634 1.681621
v 1.741822 -7.664789 4.169018
v 1.718504 -7.797035 3.407457
v -6.641035 -6.323022 3.407457
v 4.191429 6.227620 1.681621
v -6.617718 -6.190779 4.169018
v 4.168111 6.095374 0.920061
v -4.191429 7.569388 0.920061
v -4.191429 6.227621 1.681620
v 6.617716 -6.190779 4.169018
v 6.641035 -6.323024 3.407457
v -1.718504 -7.797033 3.407457
v 4.168111 7.701632 1.681621
v -1.741822 -7.664789 4.169018
v 4.191429 7.569387 0.920061
v -4.168111 6.095377 0.920061
v 2.190794 0.007711 1.190794
v 2.190794 0.007711 -1.190793
v 2.190794 7.089298 -1.190794
v -2.190794 7.089298 -1.190794
v -2.190794 7.089298 1.190793
v 2.190794 7.089298 1.190793
v -2.190794 0.007711 -1.190793
v -2.190794 0.007711 1.190794
v -4.160896 7.689532 1.674153
v 1.734052 -7.655836 4.158352
v 1.711289 -7.784933 3.414925
v -6.630116 -6.314117 3.414925
v 4.180511 6.218716 1.674153
v -6.607354 -6.185023 4.158352
v 4.157747 6.089618 0.930726
v -4.183659 7.560435 0.930726
v -4.180511 6.218717 1.674152
v 6.607353 -6.185023 4.158352
v 6.630116 -6.314119 3.414925
v -1.711289 -7.784931 3.414925
v 4.160896 7.689529 1.674153
v -1.734053 -7.655836 4.158352
v 4.183659 7.560434 0.930727
v -4.157747 6.089621 0.930726
vn 1.0000 -0.0000 -0.0000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn 0.0302 0.1710 0.9848
vn -0.0302 -0.1710 -0.9848
vn 0.1710 0.9698 -0.1737
vn 0.9848 -0.1736 -0.0000
vn -0.9848 0.1736 -0.0000
vn -0.1710 -0.9698 0.1736
vn -0.0302 0.1710 0.9848
vn 0.0302 -0.1710 -0.9848
vn -0.1710 0.9698 -0.1736
vn 0.9848 0.1736 -0.0000
vn -0.9848 -0.1736 -0.0000
vn 0.1710 -0.9698 0.1736
vn -0.1710 -0.9698 0.1737
vn 0.1710 0.9698 -0.1736
vt 0.250000 0.375000
vt 0.250000 0.000000
vt 0.312500 0.000000
vt 0.312500 0.375000
vt 0.312500 0.500000
vt 0.437500 0.375000
vt 0.437500 0.500000
vt 0.562500 0.375000
vt 0.562500 0.500000
vt 0.437500 0.000000
vt 0.500000 0.000000
vt 0.500000 0.375000
vt 0.625000 0.375000
vt 0.625000 0.000000
vt 0.032859 0.558649
vt 0.032859 0.998468
vt 0.362724 0.998468
vt 0.362724 0.558649
vt 0.039157 0.992309
vt 0.039157 0.656118
vt 0.060169 0.656118
vt 0.060169 0.992309
vt -0.003415 0.501261
vt 0.368238 0.501261
vt 0.368238 0.563203
vt -0.003415 0.563203
vt 0.368238 0.996797
vt -0.003415 0.996797
vt -0.003415 0.934855
vt 0.368238 0.934855
vt 0.394691 0.498800
vt 0.394691 0.994336
vt 0.363720 0.994336
vt 0.363720 0.498800
vt 0.032859 0.558649
vt 0.362724 0.558649
vt 0.368238 0.934855
vt -0.003415 0.934855
vt 0.368238 0.501261
vt -0.003415 0.501261
vt -0.003415 0.563203
vt 0.368238 0.563203
vt 0.394691 0.498800
vt 0.363720 0.498800
s 0
f 6/1/1 1/2/1 2/3/1 3/4/1
f 6/5/2 3/4/2 4/6/2 5/7/2
f 8/7/3 7/6/3 2/8/3 1/9/3
f 4/6/4 3/4/4 2/3/4 7/10/4
f 7/10/5 8/11/5 5/12/5 4/6/5
f 6/13/6 5/12/6 8/11/6 1/14/6
f 13/15/7 9/16/7 14/17/7 10/18/7
f 15/15/8 11/18/8 12/17/8 16/16/8
f 9/19/9 13/20/9 15/21/9 16/22/9
f 13/23/10 10/24/10 11/25/10 15/26/10
f 14/27/11 9/28/11 16/29/11 12/30/11
f 10/31/12 14/32/12 12/33/12 11/34/12
f 21/16/13 17/35/13 22/36/13 18/17/13
f 23/16/14 19/17/14 20/36/14 24/35/14
f 17/20/15 21/19/15 23/22/15 24/21/15
f 21/28/16 18/27/16 19/37/16 23/38/16
f 22/39/17 17/40/17 24/41/17 20/42/17
f 18/32/18 22/43/18 20/44/18 19/33/18
f 30/1/5 27/4/5 26/3/5 25/2/5
f 30/5/3 29/7/3 28/6/3 27/4/3
f 32/7/2 25/9/2 26/8/2 31/6/2
f 28/6/6 31/10/6 26/3/6 27/4/6
f 31/10/1 28/6/1 29/12/1 32/11/1
f 30/13/4 25/14/4 32/11/4 29/12/4
f 37/15/8 34/18/8 38/17/8 33/16/8
f 39/15/7 40/16/7 36/17/7 35/18/7
f 33/19/19 40/22/19 39/21/19 37/20/19
f 37/23/11 39/26/11 35/25/11 34/24/11
f 38/27/10 36/30/10 40/29/10 33/28/10
f 34/31/20 35/34/20 36/33/20 38/32/20
f 45/16/14 42/17/14 46/36/14 41/35/14
f 47/16/13 48/35/13 44/36/13 43/17/13
f 41/20/18 48/21/18 47/22/18 45/19/18
f 45/28/17 47/38/17 43/37/17 42/27/17
f 46/39/16 44/42/16 48/41/16 41/40/16
f 42/32/15 43/33/15 44/44/15 46/43/15

View file

@ -0,0 +1,51 @@
# Blender 4.0.2
# www.blender.org
o head
v 2.300000 -0.000170 -2.300000
v 2.300000 4.599828 2.299999
v -2.300000 4.599828 2.299999
v 2.300000 -0.000170 2.300000
v -2.300000 4.599828 -2.300000
v 2.300000 4.599828 -2.300000
v -2.300000 -0.000170 -2.300000
v -2.300000 -0.000170 2.300000
v 2.286139 0.013690 -2.286139
v 2.286139 4.585968 2.286139
v -2.286139 4.585968 2.286139
v 2.286139 0.013690 2.286139
v -2.286139 4.585968 -2.286140
v 2.286139 4.585968 -2.286140
v -2.286139 0.013690 -2.286139
v -2.286139 0.013690 2.286139
vn 1.0000 -0.0000 -0.0000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vt 0.500000 0.750000
vt 0.500000 0.500000
vt 0.625000 0.500000
vt 0.625000 0.750000
vt 0.750000 0.750000
vt 0.750000 1.000000
vt 0.625000 1.000000
vt 0.875000 0.750000
vt 0.875000 1.000000
vt 0.750000 0.500000
vt 0.875000 0.500000
vt 1.000000 0.750000
vt 1.000000 0.500000
s 0
f 2/1/1 4/2/1 1/3/1 6/4/1
f 5/5/2 3/6/2 2/7/2 6/4/2
f 1/8/3 4/9/3 8/6/3 7/5/3
f 5/5/4 6/4/4 1/3/4 7/10/4
f 3/8/5 5/5/5 7/10/5 8/11/5
f 2/12/6 3/8/6 8/11/6 4/13/6
f 10/1/5 14/4/5 9/3/5 12/2/5
f 13/5/3 14/4/3 10/7/3 11/6/3
f 9/8/2 15/5/2 16/6/2 12/9/2
f 13/5/6 15/10/6 9/3/6 14/4/6
f 11/8/1 16/11/1 15/10/1 13/5/1
f 10/12/4 12/13/4 16/11/4 11/8/4

View file

@ -0,0 +1,64 @@
# Blender 4.0.2
# www.blender.org
o leg_left
v -1.200000 7.000000 -1.300000
v 1.200000 -0.000000 1.300001
v 1.200000 -0.000000 -1.299999
v -1.200000 -0.000000 -1.299999
v 1.400000 -0.099999 1.500001
v -1.200000 7.000000 1.300000
v -1.400000 3.475000 -1.500000
v 1.400000 3.475000 -1.500000
v -1.400000 3.475000 1.500000
v 1.200000 7.000000 1.300000
v 1.400000 -0.100001 -1.499999
v 1.400000 3.475000 1.500000
v 1.200000 7.000000 -1.300000
v -1.400000 -0.099999 1.500001
v -1.200000 -0.000000 1.300001
v -1.400000 -0.100001 -1.499999
vn -0.0000 1.0000 -0.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vt 0.125000 0.375000
vt 0.125000 0.500000
vt 0.062500 0.500000
vt 0.062500 0.375000
vt 0.187500 0.375000
vt 0.125000 0.000000
vt 0.187500 0.000000
vt 0.062500 0.000000
vt 0.250000 0.375000
vt 0.250000 0.000000
vt 0.000000 0.375000
vt 0.000000 0.000000
vt 0.187500 0.500000
vt 0.390625 0.839844
vt 0.390625 0.871094
vt 0.375000 0.871094
vt 0.375000 0.839844
vt 0.343750 0.839844
vt 0.359375 0.839844
vt 0.359375 0.785156
vt 0.343750 0.785156
vt 0.406250 0.839844
vt 0.390625 0.785156
vt 0.406250 0.785156
vt 0.375000 0.785156
vt 0.359375 0.871094
s 0
f 1/1/1 6/2/1 10/3/1 13/4/1
f 13/5/2 10/1/2 2/6/2 3/7/2
f 1/1/3 13/4/3 3/8/3 4/6/3
f 10/9/4 6/5/4 15/7/4 2/10/4
f 6/11/5 1/4/5 4/8/5 15/12/5
f 3/5/6 2/13/6 15/2/6 4/1/6
f 11/14/6 5/15/6 14/16/6 16/17/6
f 9/18/5 7/19/5 16/20/5 14/21/5
f 12/22/4 9/14/4 14/23/4 5/24/4
f 7/17/3 8/19/3 11/20/3 16/25/3
f 8/14/2 12/17/2 5/25/2 11/23/2
f 7/17/1 9/16/1 12/26/1 8/19/1

View file

@ -0,0 +1,64 @@
# Blender 4.0.2
# www.blender.org
o leg_right
v 1.200000 7.000000 -1.300000
v -1.200000 7.000000 1.300000
v 1.200000 -0.000000 -1.299999
v -1.200000 -0.000000 1.300001
v 1.400000 3.475000 -1.500000
v 1.400000 -0.099999 1.500001
v -1.400000 -0.099999 1.500001
v -1.200000 -0.000000 -1.299999
v -1.200000 7.000000 -1.300000
v -1.400000 3.475000 1.500000
v 1.400000 3.475000 1.500000
v -1.400000 3.475000 -1.500000
v -1.400000 -0.100001 -1.499999
v 1.200000 -0.000000 1.300001
v 1.400000 -0.100001 -1.499999
v 1.200000 7.000000 1.300000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -0.0000 -0.0000 -1.0000
vn -1.0000 -0.0000 -0.0000
vt 0.125000 0.375000
vt 0.062500 0.375000
vt 0.062500 0.500000
vt 0.125000 0.500000
vt 0.187500 0.375000
vt 0.187500 0.500000
vt 0.000000 0.375000
vt 0.000000 0.000000
vt 0.062500 0.000000
vt 0.250000 0.375000
vt 0.250000 0.000000
vt 0.187500 0.000000
vt 0.125000 0.000000
vt 0.390625 0.839844
vt 0.390625 0.785156
vt 0.375000 0.785156
vt 0.375000 0.839844
vt 0.359375 0.785156
vt 0.359375 0.839844
vt 0.406250 0.839844
vt 0.406250 0.785156
vt 0.343750 0.839844
vt 0.343750 0.785156
vt 0.375000 0.871094
vt 0.390625 0.871094
vt 0.359375 0.871094
s 0
f 1/1/1 9/2/1 2/3/1 16/4/1
f 8/5/2 3/1/2 14/4/2 4/6/2
f 16/7/3 14/8/3 3/9/3 1/2/3
f 2/10/4 4/11/4 14/12/4 16/5/4
f 1/1/5 3/13/5 8/9/5 9/2/5
f 9/5/6 8/12/6 4/13/6 2/1/6
f 12/14/6 13/15/6 7/16/6 10/17/6
f 5/17/5 15/16/5 13/18/5 12/19/5
f 10/20/4 7/21/4 6/15/4 11/14/4
f 11/22/3 6/23/3 15/18/3 5/19/3
f 13/14/2 15/17/2 6/24/2 7/25/2
f 5/17/1 12/19/1 10/26/1 11/24/1

View file

@ -201,6 +201,8 @@ end
function mob_class:set_velocity(v)
if not v then return end
v = 0
local c_x, c_y = 0, 0
-- can mob be pushed, if so calculate direction
@ -311,6 +313,8 @@ end
function mob_class:set_yaw(yaw, delay, dtime)
if self.noyaw then return end
yaw = 0
if not self.object:get_yaw() or not self.object:get_pos() then return end
if self.state ~= PATHFINDING then

View file

@ -96,6 +96,15 @@ local skeleton = {
die_speed = 15,
die_loop = false,
},
wears_armor = 1,
armor_transforms = { -- scaled down armor becuase of the scaled up skeleton model
head = {"head", vector.new(0,-0.2,0), vector.new(0,180,0), vector.new(0.44,0.44,0.44)},
chest = {"body", vector.new(0,-0.5,0), vector.new(0,180,0), vector.new(0.44,0.44,0.44)},
arm_right = {"arm.right", vector.new(0,-0.5,0), vector.new(0,180,0), vector.new(0.33,0.33,0.33)},
arm_left = {"arm.left", vector.new(0,-0.5,0), vector.new(0,180,0), vector.new(0.33,0.33,0.33)},
leg_right = {"leg.right", vector.zero(), vector.new(0,180,0), vector.new(0.33,0.33,0.33)},
leg_left = {"leg.left", vector.zero(), vector.new(0,180,0), vector.new(0.33,0.33,0.33)}
},
on_spawn = function(self)
if math.random(100) == 1 then
self:jock_to("mobs_mc:spider", vector.zero(), vector.zero())

View file

@ -60,6 +60,14 @@ local zombie = {
head_pitch_multiplier=-1,
breath_max = -1,
wears_armor = 1,
armor_transforms = {
head = {"head", vector.zero()},
chest = {"body", vector.zero()},
arm_right = {"arm.right", vector.new(0,-0.9,0)},
arm_left = {"arm.left", vector.new(0,-0.9,0)},
leg_right = {"leg.right", vector.zero()},
leg_left = {"leg.left", vector.zero()}
},
armor = {undead = 90, fleshy = 90},
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.8, 0.3},
visual = "mesh",