add taming countdown infotext

* do not need to fix knockback cos i do not change
  things constantly, code was already working
main
general 2024-03-30 03:53:40 -04:00
parent 0a86398377
commit c876bb63c7
1 changed files with 5 additions and 1 deletions

View File

@ -33,7 +33,7 @@ local use_mc2 = minetest.get_modpath("mcl_core")
-- Global
mobs = {
mod = "redo",
version = "20231011",
version = "20231012",
translate = S, intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {},
node_ice = "default:ice",
@ -217,6 +217,7 @@ mobs.mob_class = {
friendly_fire = true,
facing_fence = false,
_breed_countdown = nil,
_tame_countdown = nil,
_cmi_is_mob = true
}
@ -832,6 +833,8 @@ function mob_class:update_tag()
text = "\nLoving: " .. (self.hornytimer - (HORNY_TIME + HORNY_AGAIN_TIME))
elseif self.child == true then
text = "\nGrowing: " .. (self.hornytimer - CHILD_GROW_TIME)
elseif self._tame_countdown then
text = "\nTaming: " .. self._tame_countdown
elseif self._breed_countdown then
text = "\nBreeding: " .. self._breed_countdown
end
@ -4807,6 +4810,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
-- feed and tame
self.food = (self.food or 0) + 1
self._breed_countdown = breed and (feed_count - self.food)
self._tame_countdown = not self.tamed and tame and (feed_count - self.food)
if self.food >= feed_count then