Merge pull request 'Make enderman and spider's eyes glow' (#2712) from spider_ender_eyes_glow into master

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2712
Reviewed-by: cora <cora@noreply.git.minetest.land>
This commit is contained in:
cora 2022-10-05 22:29:36 +00:00
commit a2ce3e8a49
2 changed files with 59 additions and 1 deletions

View File

@ -24,6 +24,23 @@
-- added rain damage. -- added rain damage.
-- fixed the grass_with_dirt issue. -- fixed the grass_with_dirt issue.
minetest.register_entity("mobs_mc:ender_eyes", {
visual = "mesh",
mesh = "mobs_mc_spider.b3d",
visual_size = {x=1.01, y=1.01},
textures = {
"mobs_mc_enderman_eyes.png",
},
on_activate = function(self)
minetest.after(0.1, function()
if not self.object:get_attach() then
self.object:remove()
end
end)
end,
glow = 50,
})
local S = minetest.get_translator("mobs_mc") local S = minetest.get_translator("mobs_mc")
local telesound = function(pos, is_source) local telesound = function(pos, is_source)
@ -237,6 +254,19 @@ mcl_mobs:register_mob("mobs_mc:enderman", {
textures = create_enderman_textures(), textures = create_enderman_textures(),
visual_size = {x=3, y=3}, visual_size = {x=3, y=3},
makes_footstep_sound = true, makes_footstep_sound = true,
on_spawn = function(self)
local spider_eyes=false
for n = 1, #self.object:get_children() do
local obj = self.object:get_children()[n]
if obj:get_luaentity() and self.object:get_luaentity().name == "mobs_mc:ender_eyes" then
spider_eyes = true
end
end
if not spider_eyes then
minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.low", vector.new(0,3.25,-1.98), vector.new(90,0,180))
minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.low", vector.new(1,3.25,-1.98), vector.new(90,0,180))
end
end,
sounds = { sounds = {
-- TODO: Custom war cry sound -- TODO: Custom war cry sound
war_cry = "mobs_sandmonster", war_cry = "mobs_sandmonster",

View File

@ -11,6 +11,22 @@ local S = minetest.get_translator("mobs_mc")
-- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture) -- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture)
minetest.register_entity("mobs_mc:spider_eyes", {
visual = "mesh",
mesh = "mobs_mc_spider.b3d",
visual_size = {x=1.01, y=1.01},
textures = {
"mobs_mc_spider_eyes.png",
},
on_activate = function(self)
minetest.after(0.1, function()
if not self.object:get_attach() then
self.object:remove()
end
end)
end,
glow = 50,
})
local spider = { local spider = {
description = S("Spider"), description = S("Spider"),
@ -27,11 +43,23 @@ local spider = {
xp_min = 5, xp_min = 5,
xp_max = 5, xp_max = 5,
armor = {fleshy = 100, arthropod = 100}, armor = {fleshy = 100, arthropod = 100},
on_spawn = function(self)
local spider_eyes=false
for n = 1, #self.object:get_children() do
local obj = self.object:get_children()[n]
if obj:get_luaentity() and self.object:get_luaentity().name == "mobs_mc:spider_eyes" then
spider_eyes = true
end
end
if not spider_eyes then
minetest.add_entity(self.object:get_pos(), "mobs_mc:spider_eyes"):set_attach(self.object, "body.head", vector.new(0,-0.98,2), vector.new(90,180,180))
end
end,
collisionbox = {-0.7, -0.01, -0.7, 0.7, 0.89, 0.7}, collisionbox = {-0.7, -0.01, -0.7, 0.7, 0.89, 0.7},
visual = "mesh", visual = "mesh",
mesh = "mobs_mc_spider.b3d", mesh = "mobs_mc_spider.b3d",
textures = { textures = {
{"mobs_mc_spider.png^(mobs_mc_spider_eyes.png^[makealpha:0,0,0)"}, {"mobs_mc_spider.png"},
}, },
visual_size = {x=3, y=3}, visual_size = {x=3, y=3},
makes_footstep_sound = false, makes_footstep_sound = false,