This commit is contained in:
somechris 2024-11-17 10:06:16 +01:00 committed by GitHub
commit d19b1583e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -594,12 +594,12 @@ function animalia.random_sound(self)
end end
end end
function animalia.add_trust(self, player, amount) function animalia.add_trust(self, player, amount, max)
if self.trust_cooldown > 0 then return end if self.trust_cooldown > 0 then return end
self.trust_cooldown = 60 self.trust_cooldown = 60
local plyr_name = player:get_player_name() local plyr_name = player:get_player_name()
local trust = self.trust[plyr_name] or 0 local trust = self.trust[plyr_name] or 0
if trust > 4 then return end if trust >= (max or 5) then return end
self.trust[plyr_name] = trust + (amount or 1) self.trust[plyr_name] = trust + (amount or 1)
self:memorize("trust", self.trust) self:memorize("trust", self.trust)
end end

View file

@ -636,7 +636,7 @@ function animalia.action_play(self, target)
if stage == 2 if stage == 2
and dist < mob.width + 1 then and dist < mob.width + 1 then
animalia.add_trust(mob, target, 1) animalia.add_trust(mob, target, 1, 10)
stage = 3 stage = 3
end end