master
runs 2019-08-28 22:53:09 +02:00
parent b16bc37921
commit 6811cc4c2c
6 changed files with 16 additions and 13 deletions

View File

@ -1265,17 +1265,19 @@ function mobkit.stepfunc(self,dtime) -- not intended to be modified
local surface = nil
local snodepos = mobkit.get_node_pos(spos)
local surfnode = mobkit.nodeatpos(spos)
local stand_pos = spos --added by petz
stand_pos.y = spos.y + 0.5 --added by petz
local stand_node_pos = mobkit.get_node_pos(stand_pos) --added by petz
local stand_node = mobkit.nodeatpos(stand_node_pos) --added by petz
if stand_node and stand_node.walkable and stand_node.drawtype == "normal" then -- if standing inside solid block then jump to escape --added by petz
self.object:set_pos({ --added by petz
x = stand_pos.x, --added by petz
y = stand_pos.y + self.jump_height, --added by petz
z = stand_pos.z --added by petz
}) --added by petz
end --added by petz
if mobkit.is_alive(self) then
local stand_pos = spos --added by petz
stand_pos.y = spos.y + 0.5 --added by petz
local stand_node_pos = mobkit.get_node_pos(stand_pos) --added by petz
local stand_node = mobkit.nodeatpos(stand_node_pos) --added by petz
if stand_node and stand_node.walkable and stand_node.drawtype == "normal" then -- if standing inside solid block then jump to escape --added by petz
self.object:set_pos({ --added by petz
x = stand_pos.x, --added by petz
y = stand_pos.y + self.jump_height, --added by petz
z = stand_pos.z --added by petz
}) --added by petz
end --added by petz
end
while surfnode and surfnode.drawtype == 'liquid' do
surface = snodepos.y+0.5
if surface > spos.y+self.height then break end

View File

@ -2,4 +2,4 @@ name = petz
description = Cute mobs for Minetest
depends = default, mobkit, stairs, dye, farming, vessels, wool
optional_depends = bonemeal, 3d_armor
version = 3.3.11
version = 3.3.12

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -37,7 +37,7 @@ minetest.register_entity("petz:"..pet_name,{
-- api props
springiness= 0,
buoyancy = 0.5, -- portion of hitbox submerged
max_speed = 1,
max_speed = 2.0,
jump_height = 2.0,
view_range = 10,
lung_capacity = 32767, -- seconds
@ -47,6 +47,7 @@ minetest.register_entity("petz:"..pet_name,{
swin={range={x=1, y=13}, speed=20, loop=true},
stand={
{range={x=13, y=25}, speed=5, loop=true},
{range={x=28, y=43}, speed=5, loop=true},
},
},