mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-07-25 19:40:22 +02:00
Compare commits
2 Commits
10e4dd92a0
...
11e1d52cfb
Author | SHA1 | Date | |
---|---|---|---|
11e1d52cfb | |||
c158e84e28 |
22
api.lua
22
api.lua
@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20210114",
|
version = "20210206",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -539,12 +539,10 @@ local ray_line_of_sight = function(self, pos1, pos2)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- detect if using minetest 5.0 by searching for permafrost node
|
|
||||||
local is_50 = minetest.registered_nodes["default:permafrost"]
|
|
||||||
|
|
||||||
function mob_class:line_of_sight(pos1, pos2, stepsize)
|
function mob_class:line_of_sight(pos1, pos2, stepsize)
|
||||||
|
|
||||||
if is_50 then -- only use if minetest 5.0 is detected
|
if minetest.raycast then -- only use if minetest 5.0 is detected
|
||||||
return ray_line_of_sight(self, pos1, pos2)
|
return ray_line_of_sight(self, pos1, pos2)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1354,11 +1352,15 @@ function mob_class:breed()
|
|||||||
self.on_grown(self)
|
self.on_grown(self)
|
||||||
else
|
else
|
||||||
-- jump when fully grown so as not to fall into ground
|
-- jump when fully grown so as not to fall into ground
|
||||||
self.object:set_velocity({
|
-- self.object:set_velocity({
|
||||||
x = 0,
|
-- x = 0,
|
||||||
y = self.jump_height,
|
-- y = self.jump_height,
|
||||||
z = 0
|
-- z = 0
|
||||||
})
|
-- })
|
||||||
|
local pos = self.object:get_pos() ; if not pos then return end
|
||||||
|
local ent = self.object:get_luaentity()
|
||||||
|
pos.y = pos.y + (ent.collisionbox[2] * -1) - 0.4
|
||||||
|
self.object:set_pos(pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1458,6 +1460,8 @@ function mob_class:breed()
|
|||||||
effect(pos, 15, "tnt_smoke.png", 1, 2, 2, 15, 5)
|
effect(pos, 15, "tnt_smoke.png", 1, 2, 2, 15, 5)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
pos.y = pos.y + 0.5 -- spawn child a little higher
|
||||||
|
|
||||||
local mob = minetest.add_entity(pos, self.name)
|
local mob = minetest.add_entity(pos, self.name)
|
||||||
local ent2 = mob:get_luaentity()
|
local ent2 = mob:get_luaentity()
|
||||||
local textures = self.base_texture
|
local textures = self.base_texture
|
||||||
|
Reference in New Issue
Block a user