add taming countdown infotext
* do not need to fix knockback cos i do not change things constantly, code was already working
This commit is contained in:
parent
0a86398377
commit
c876bb63c7
6
api.lua
6
api.lua
@ -33,7 +33,7 @@ local use_mc2 = minetest.get_modpath("mcl_core")
|
|||||||
-- Global
|
-- Global
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20231011",
|
version = "20231012",
|
||||||
translate = S, intllib = S,
|
translate = S, intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {},
|
invis = minetest.global_exists("invisibility") and invisibility or {},
|
||||||
node_ice = "default:ice",
|
node_ice = "default:ice",
|
||||||
@ -217,6 +217,7 @@ mobs.mob_class = {
|
|||||||
friendly_fire = true,
|
friendly_fire = true,
|
||||||
facing_fence = false,
|
facing_fence = false,
|
||||||
_breed_countdown = nil,
|
_breed_countdown = nil,
|
||||||
|
_tame_countdown = nil,
|
||||||
_cmi_is_mob = true
|
_cmi_is_mob = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -832,6 +833,8 @@ function mob_class:update_tag()
|
|||||||
text = "\nLoving: " .. (self.hornytimer - (HORNY_TIME + HORNY_AGAIN_TIME))
|
text = "\nLoving: " .. (self.hornytimer - (HORNY_TIME + HORNY_AGAIN_TIME))
|
||||||
elseif self.child == true then
|
elseif self.child == true then
|
||||||
text = "\nGrowing: " .. (self.hornytimer - CHILD_GROW_TIME)
|
text = "\nGrowing: " .. (self.hornytimer - CHILD_GROW_TIME)
|
||||||
|
elseif self._tame_countdown then
|
||||||
|
text = "\nTaming: " .. self._tame_countdown
|
||||||
elseif self._breed_countdown then
|
elseif self._breed_countdown then
|
||||||
text = "\nBreeding: " .. self._breed_countdown
|
text = "\nBreeding: " .. self._breed_countdown
|
||||||
end
|
end
|
||||||
@ -4807,6 +4810,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
|
|||||||
-- feed and tame
|
-- feed and tame
|
||||||
self.food = (self.food or 0) + 1
|
self.food = (self.food or 0) + 1
|
||||||
self._breed_countdown = breed and (feed_count - self.food)
|
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
|
if self.food >= feed_count then
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user