master
runs 2020-01-07 23:00:04 +01:00
parent b35350236d
commit 14a3c3ebd5
19 changed files with 138 additions and 110 deletions

View File

@ -72,7 +72,8 @@ petz.childbirth = function(self)
if math.random(1, 2) == 1 then
baby_type = "petz:elephant_female" --could be a female baby elephant
end
end
end
pos.y = pos.y + 1.01 -- birth a litte up
local baby = minetest.add_entity(pos, baby_type, minetest.serialize(baby_properties))
local baby_entity = baby:get_luaentity()
baby_entity.is_baby = true
@ -127,11 +128,17 @@ petz.growth_timer = function(self, dtime)
self.growth_time = mobkit.remember(self, "growth_time", self.growth_time + dtime)
if self.growth_time >= petz.settings.growth_time then
self.is_baby = mobkit.remember(self, "is_baby", false)
local pos = self.object:get_pos()
pos.y = pos.y + 1.01 -- grows a litte up
self.object:set_pos(pos)
local vel = self.object:get_velocity()
vel.y=vel.y + 4.0
self.object:set_velocity(vel)
petz.set_properties(self, {
jump = false,
is_baby = false,
visual_size = self.visual_size,
collisionbox = self.collisionbox
})
})
end
end

View File

@ -8,7 +8,7 @@ petz.get_collisionbox = function(p1, p2, scale_model, scale_baby)
if scale_baby then
p1b = vector.multiply(p1, scale_baby)
p2b = vector.multiply(p2, scale_baby)
collisionbox_baby = {p1.x, p1.y, p1.z, p2.x, p2.y, p2.z}
collisionbox_baby = {p1b.x, p1b.y, p1b.z, p2b.x, p2b.y, p2b.z}
end
return collisionbox, collisionbox_baby
end

View File

@ -209,7 +209,7 @@ function petz.set_initial_properties(self, staticdata, dtime_s)
self.genes["gen2"] = static_data_table["gen1_mother"]
else
self.genes["gen2"] = static_data_table["gen2_mother"]
end
end
end
local textures_count
if self.mutation and (self.mutation > 0) then

View File

@ -239,6 +239,14 @@ function petz.herbivore_brain(self)
end
end
end
--if prty < 7 and self.type == "moth" and mobkit.is_queue_empty_high(self) then --search for a squareball
--local pos_torch_near = minetest.find_node_near(pos, self.view_range, "default:torch")
--if pos_torch_near then
--mobkit.hq_approach_torch(self, 7, pos_torch_near)
--return
--end
--end
--Replace nodes by others
if prty < 6 then
@ -273,13 +281,6 @@ function petz.herbivore_brain(self)
end
end
--if prty < 5 and self.type == "moth" then --search for a squareball
--local pos_torch_near = minetest.find_node_near(self.object:get_pos(), 10, "default:torch")
--if pos_torch_near then
--mobkit.hq_goto(self, 5, pos_torch_near)
--end
--end
--search for a petz:pet_bowl
if prty < 4 and self.tamed == true then
local view_range = self.view_range

View File

@ -124,7 +124,7 @@ function mobkit.hq_followliquidair(self, prty, player)
end
if pos and tpos then
local distance = vector.distance(pos, tpos)
if distance < self.view_range then
if (distance < self.view_range) then
if mobkit.is_queue_empty_low(self) then
mobkit.lq_followliquidair(self, pos, tpos)
end
@ -139,6 +139,26 @@ function mobkit.hq_followliquidair(self, prty, player)
mobkit.queue_high(self, func, prty)
end
function mobkit.hq_approach_torch(self, prty, tpos)
local func=function(self)
local pos = self.object:get_pos()
if pos and tpos then
local distance = vector.distance(pos, tpos)
if distance < self.view_range and (distance >= self.view_range) then
if mobkit.is_queue_empty_low(self) then
mobkit.lq_followliquidair(self, pos, tpos)
end
elseif distance >= self.view_range then
petz.ownthing(self)
return true
end
else
return true
end
end
mobkit.queue_high(self, func, prty)
end
function mobkit.lq_followliquidair(self, pos, tpos)
local func = function(self)
local dir = vector.direction(pos, tpos)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,101 +1,101 @@
mtllib petz_wolf.mtl
o converted_out
v 0.125 -0.375 -0.375
v 0.125 -0.375 -0.25
v 0.125 -0.3125 -0.25
v 0.125 -0.3125 -0.375
v -0.0625 -0.375 -0.375
v -0.0625 -0.375 -0.25
v -0.0625 -0.3125 -0.25
v -0.0625 -0.3125 -0.375
v 0.125 -0.25 -0.5
v 0.125 -0.25 -0.3125
v 0.125 -0.1875 -0.3125
v 0.125 -0.1875 -0.5
v -0.0625 -0.25 -0.5
v -0.0625 -0.25 -0.3125
v -0.0625 -0.1875 -0.3125
v -0.0625 -0.1875 -0.5
v 0.1875 -0.5 -0.1875
v 0.1875 -0.5 -0.125
v 0.1875 -0.25 -0.125
v 0.1875 -0.25 -0.1875
v 0.125 -0.5 -0.1875
v 0.125 -0.5 -0.125
v 0.125 -0.3125 -0.125
v 0.125 -0.3125 -0.1875
v 0.0625 -0.5 -0.1875
v 0.0625 -0.5 -0.125
v 0.0625 -0.3125 -0.125
v 0.0625 -0.3125 -0.1875
v -0 -0.5 -0.1875
v -0 -0.5 -0.125
v -0 -0.3125 -0.125
v -0 -0.3125 -0.1875
v 0.125 -0.25 -0.125
v 0.125 -0.25 -0.1875
v -0.0625 -0.5 -0.1875
v -0.0625 -0.5 -0.125
v -0.0625 -0.3125 -0.125
v -0.0625 -0.3125 -0.1875
v 0.125 -0.3125 -0.375
v 0.125 -0.3125 -0.3125
v 0.125 -0.25 -0.3125
v 0.125 -0.25 -0.375
v -0.0625 -0.3125 -0.375
v -0.0625 -0.3125 -0.3125
v -0.0625 -0.25 -0.3125
v -0.0625 -0.25 -0.375
v 0.125 -0.3125 -0.3125
v 0.125 -0.3125 -0.1875
v 0.125 -0.125 -0.1875
v 0.125 -0.125 -0.3125
v -0.0625 -0.3125 -0.3125
v -0.0625 -0.3125 -0.1875
v -0.0625 -0.125 -0.1875
v -0.0625 -0.125 -0.3125
v 0.1875 -0.3125 -0.1875
v 0.1875 -0.3125 -0.0625
v 0.1875 -0.125 -0.0625
v 0.1875 -0.125 -0.1875
v -0.125 -0.3125 -0.1875
v -0.125 -0.3125 -0.0625
v -0.125 -0.125 -0.0625
v -0.125 -0.125 -0.1875
v 0.125 -0.3125 -0.0625
v 0.125 -0.3125 0.1875
v 0.125 -0.125 0.1875
v 0.125 -0.125 -0.0625
v -0.0625 -0.3125 -0.0625
v -0.0625 -0.3125 0.1875
v -0.0625 -0.125 0.1875
v -0.0625 -0.125 -0.0625
v 0.125 -0.125 -0.25
v 0.125 -0.125 -0.1875
v 0.125 -0.0625 -0.1875
v 0.125 -0.0625 -0.25
v 0.0625 -0.125 -0.25
v 0.0625 -0.125 -0.1875
v 0.0625 -0.0625 -0.1875
v 0.0625 -0.0625 -0.25
v -0 -0.125 -0.25
v -0 -0.125 -0.1875
v -0 -0.0625 -0.1875
v -0 -0.0625 -0.25
v -0.0625 -0.125 -0.25
v -0.0625 -0.125 -0.1875
v -0.0625 -0.0625 -0.1875
v -0.0625 -0.0625 -0.25
v -0 -0.5 0.125
v -0 -0.5 0.1875
v -0 -0.3125 0.1875
v -0 -0.3125 0.125
v -0.0625 -0.5 0.125
v -0.0625 -0.5 0.1875
v -0.0625 -0.3125 0.1875
v -0.0625 -0.3125 0.125
v 0.125 -0.5 0.125
v 0.125 -0.5 0.1875
v 0.125 -0.3125 0.1875
v 0.125 -0.3125 0.125
v 0.0625 -0.5 0.125
v 0.0625 -0.5 0.1875
v 0.0625 -0.3125 0.1875
v 0.0625 -0.3125 0.125
v 0.0625 -0.1875 0.1875
v 0.0625 -0.1875 0.375
v 0.0625 -0.125 0.375
v 0.0625 -0.125 0.1875
v -0 -0.1875 0.1875
v -0 -0.1875 0.375
v -0 -0.125 0.375
v -0 -0.125 0.1875
v -0.0625 -0.25 -0.125
v -0.0625 -0.25 -0.1875
v -0.125 -0.5 -0.1875
v -0.125 -0.5 -0.125
v -0.125 -0.25 -0.125
v -0.125 -0.25 -0.1875
v 0.125 -0.1875 -0.5
v 0.125 -0.1875 -0.375
v 0.125 -0.125 -0.375
v 0.125 -0.125 -0.5
v -0.0625 -0.1875 -0.5
v -0.0625 -0.1875 -0.375
v -0.0625 -0.125 -0.375
v -0.0625 -0.125 -0.5
v 0.1875 -0.25 -0.375
v 0.1875 -0.25 -0.25
v 0.1875 0.0625 -0.25
v 0.1875 0.0625 -0.375
v -0.125 -0.25 -0.375
v -0.125 -0.25 -0.25
v -0.125 0.0625 -0.25
v -0.125 0.0625 -0.375
v 0.25 -0.25 -0.25
v 0.25 -0.25 -0.0625
v 0.25 0.0625 -0.0625
v 0.25 0.0625 -0.25
v -0.1875 -0.25 -0.25
v -0.1875 -0.25 -0.0625
v -0.1875 0.0625 -0.0625
v -0.1875 0.0625 -0.25
v 0.1875 -0.1875 -0.0625
v 0.1875 -0.1875 0.3125
v 0.1875 0.0625 0.3125
v 0.1875 0.0625 -0.0625
v -0.125 -0.1875 -0.0625
v -0.125 -0.1875 0.3125
v -0.125 0.0625 0.3125
v -0.125 0.0625 -0.0625
v 0.125 0.0625 -0.25
v 0.125 0.0625 -0.1875
v 0.125 0.125 -0.1875
v 0.125 0.125 -0.25
v 0.0625 0.0625 -0.25
v 0.0625 0.0625 -0.1875
v 0.0625 0.125 -0.1875
v 0.0625 0.125 -0.25
v -0 0.0625 -0.25
v -0 0.0625 -0.1875
v -0 0.125 -0.1875
v -0 0.125 -0.25
v -0.0625 0.0625 -0.25
v -0.0625 0.0625 -0.1875
v -0.0625 0.125 -0.1875
v -0.0625 0.125 -0.25
v -0.0625 -0.5 0.25
v -0.0625 -0.5 0.3125
v -0.0625 -0.1875 0.3125
v -0.0625 -0.1875 0.25
v -0.125 -0.5 0.25
v -0.125 -0.5 0.3125
v -0.125 -0.1875 0.3125
v -0.125 -0.1875 0.25
v 0.1875 -0.5 0.25
v 0.1875 -0.5 0.3125
v 0.1875 -0.1875 0.3125
v 0.1875 -0.1875 0.25
v 0.125 -0.5 0.25
v 0.125 -0.5 0.3125
v 0.125 -0.1875 0.3125
v 0.125 -0.1875 0.25
v 0.0625 -0.0625 0.3125
v 0.0625 -0.0625 0.5
v 0.0625 -1.67638e-08 0.5
v 0.0625 -1.67638e-08 0.3125
v -0 -0.0625 0.3125
v -0 -0.0625 0.5
v -0 -1.67638e-08 0.5
v -0 -1.67638e-08 0.3125
usemtl none
s off
g jaw

Binary file not shown.

View File

@ -29,7 +29,7 @@ rob_mobs = false
## The interval is avg spawn attempt interval for every player
spawn_interval = 30
## Max number of mobs in the active block range
max_mobs = 30
max_mobs = 60
## Chance to spawn a mob if there are no other objects in area
# the value should be 0 - 1
spawn_chance = 0.3
@ -39,8 +39,8 @@ lashing_tame_count = 3
##Breed System
pregnant_count = 5
pregnancy_time = 1200
growth_time = 1200
pregnancy_time = 5
growth_time = 5
##Lay Eggs
#Default = 90000

View File

@ -4,11 +4,11 @@
local S = ...
local pet_name = "wolf"
local scale_model = 2.8
local scale_model = 1.8
local mesh = 'petz_wolf.b3d'
local textures = {"petz_wolf.png", "petz_wolf2.png", "petz_wolf3.png"}
local p1 = {x= -0.0625, y = -0.5, z = -0.1875}
local p2 = {x= 0.125, y = -0.125, z = 0.3125}
local p1 = {x= -0.125, y = -0.5, z = -0.3125}
local p2 = {x= 0.1875, y = 0.0625, z = 0.375}
local collisionbox, collisionbox_baby = petz.get_collisionbox(p1, p2, scale_model, scale_baby)
minetest.register_entity("petz:"..pet_name,{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 498 B

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

After

Width:  |  Height:  |  Size: 817 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 656 B

After

Width:  |  Height:  |  Size: 869 B