master
runs 2020-05-29 01:51:09 +02:00
parent 7acd6a54f2
commit 71bfd1f551
15 changed files with 20 additions and 20 deletions

View File

@ -267,7 +267,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
elseif fields.btn_fly then
mobkit.clear_queue_low(pet)
mobkit.clear_queue_high(pet)
pet.status = ""
pet.status = nil
mobkit.hq_fly(pet, 0)
minetest.after(2.5, function(pet)
if mobkit.is_alive(pet) then

View File

@ -252,7 +252,7 @@ function petz.set_initial_properties(self, staticdata, dtime_s)
self.food_count = mobkit.remember(self, "food_count", 0)
self.was_killed_by_player = mobkit.remember(self, "was_killed_by_player", false)
self.dreamcatcher = mobkit.remember(self, "dreamcatcher", false)
self.status = mobkit.remember(self, "status", "")
self.status = mobkit.remember(self, "status", nil)
self.warn_attack = mobkit.remember(self, "warn_attack", false)
self.colorized = mobkit.remember(self, "colorized", nil)
self.convert = mobkit.remember(self, "convert", nil)
@ -357,15 +357,15 @@ function petz.set_initial_properties(self, staticdata, dtime_s)
if self.is_pet and self.tamed then
petz.update_nametag(self)
end
if self.status and self.status ~= "" then
if self.status then
if self.status == "stand" then
petz.standhere(self)
elseif self.status == "guard" then
petz.guard(self)
elseif self.status == "sleep" then
self.status = "" --reset
self.status = nil --reset
else
self.status = ""
self.status = nil
end
end
end

View File

@ -1,7 +1,7 @@
local modpath, S = ...
petz.ownthing = function(self)
self.status = mobkit.remember(self, "status", "")
self.status = mobkit.remember(self, "status", nil)
if self.can_fly then
mobkit.hq_wanderfly(self, 0)
elseif self.can_swin and self.isinliquid then

View File

@ -92,7 +92,7 @@ function mobkit.hq_sleep(self, prty, force)
mobkit.clear_queue_high(self) --awake
local texture = self.textures[self.texture_no]
self.object:set_properties(self, {textures = {texture}}) --quit sleeping eyes
self.status = mobkit.remember(self, "status", "")
self.status = mobkit.remember(self, "status", nil)
return true
else
petz.do_particles_effect(self.object, self.object:get_pos(), "sleep")

View File

@ -18,7 +18,7 @@ function mobkit.hq_aqua_jump(self, prty)
mokapi.make_sound("object", self.object, "petz_splash", petz.settings.max_hear_distance)
minetest.after(0.5, function(self, velocity)
if mobkit.is_alive(self.object) then
self.status = ""
self.status = nil
mobkit.clear_queue_high(self)
end
end, self, velocity)

View File

@ -54,7 +54,7 @@ end
function mobkit.hq_climb(self, prty)
local func=function(self)
if not petz.check_tree(self) then
self.status = ""
self.status = nil
mobkit.clear_queue_high(self)
mobkit.clear_queue_low(self)
return true
@ -93,7 +93,7 @@ function mobkit.lq_climb(self)
end
if climb then
self.object:set_pos(climb_pos)
self.status = ""
self.status = nil
end
mobkit.clear_queue_high(self)
mobkit.clear_queue_low(self)

View File

@ -1,7 +1,7 @@
local modpath, S = ...
function petz.bh_look_at(self, player_pos, prty)
if not(self.status == "looking") then
if not(self.looking) then
mobkit.animate(self, "idle")
petz.hq_look_at(self, player_pos, prty)
return true
@ -10,7 +10,7 @@ end
function petz.hq_look_at(self, player_pos, prty)
local func = function(self)
if not(self.status == "looking") then
if not(self.looking) then
local random_time = math.random(2, 3)
petz.move_head(self, player_pos)
minetest.after(random_time, function(self)
@ -18,11 +18,11 @@ function petz.hq_look_at(self, player_pos, prty)
mobkit.clear_queue_low(self)
mobkit.clear_queue_high(self)
petz.return_head_to_origin(self)
self.status = ""
self.looking = false
return true
end
end, self)
self.status = "looking"
self.looking = true
end
end
mobkit.queue_high(self, func, prty)

View File

@ -69,7 +69,7 @@ function petz.aquatic_brain(self)
mokapi.make_misc_sound(self, petz.settings.misc_sound_chance, petz.settings.max_hear_distance)
--Roam default
if mobkit.is_queue_empty_high(self) and self.status == "" and not(self.status== "jump") then
if mobkit.is_queue_empty_high(self) and not(self.status) and not(self.status== "jump") then
mobkit.hq_aqua_roam(self, 0, self.max_speed)
end
end

View File

@ -111,7 +111,7 @@ function petz.bee_brain(self)
mokapi.make_misc_sound(self, petz.settings.misc_sound_chance, petz.settings.max_hear_distance)
--Roam default
if mobkit.is_queue_empty_high(self) and self.status == "" then
if mobkit.is_queue_empty_high(self) and not(self.status) then
mobkit.hq_wanderfly(self, 0)
end

View File

@ -197,7 +197,7 @@ function petz.herbivore_brain(self)
--Look_at Behaviour
if prty < 1 then
if petz.settings.look_at and player and self.head and petz.is_standing(self) and not(self.status == "looking") then
if petz.settings.look_at and player and self.head and petz.is_standing(self) and not(self.looking) then
if math.random(1, petz.settings.look_at_random) == 1 then
if petz.hq_look_at(self, player:get_pos(), 1) then
return
@ -207,7 +207,7 @@ function petz.herbivore_brain(self)
end
--Roam default
if mobkit.is_queue_empty_high(self) and self.status == "" then
if mobkit.is_queue_empty_high(self) and not(self.status) then
if not(self.can_fly) then
mobkit.hq_roam(self, 0)
else

View File

@ -89,7 +89,7 @@ function petz.predator_brain(self)
mokapi.make_misc_sound(self, petz.settings.misc_sound_chance, petz.settings.max_hear_distance)
--Roam default
if mobkit.is_queue_empty_high(self) and self.status == "" then
if mobkit.is_queue_empty_high(self) and not(self.status) then
mobkit.hq_roam(self, 0)
end

View File

@ -80,7 +80,7 @@ function petz.semiaquatic_brain(self)
end
--Roam default
if mobkit.is_queue_empty_high(self) and self.status == "" then
if mobkit.is_queue_empty_high(self) and not(self.status) then
if petz.isinliquid(self) then
mobkit.hq_aqua_roam(self, 0, self.max_speed)
else

Binary file not shown.

Binary file not shown.

Binary file not shown.