From 5105b4bfecb9c77affcbbd9356e5214222d0bef8 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:44:21 +0800 Subject: [PATCH] Fix: Limit expected emotion reduce to 29 at max --- module/combat/emotion.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module/combat/emotion.py b/module/combat/emotion.py index f0f9d5dc9..325cb56d0 100644 --- a/module/combat/emotion.py +++ b/module/combat/emotion.py @@ -133,6 +133,13 @@ class FleetEmotion: f'Fleet {self.fleet} Recover Location=\"Docks\" can not be used together, ' 'please check your emotion settings') raise RequestHumanTakeover + # In 14-4 with 2X book, expected emotion reduce is 32, can't keep happy bonus (>120), + # otherwise will infinite task delay + if self.control == 'keep_exp_bonus' and expected_reduce >= 29: + expected_reduce = 29 + logger.info(f'Fleet {self.fleet} expected_reduce is limited to 29 ' + f'when Emotion Control=\"Keep Happy Bonus\"') + recover_count = (self.limit + expected_reduce - self.current) // self.speed recovered = (int(datetime.now().timestamp()) // 360 + recover_count + 1) * 360 return datetime.fromtimestamp(recovered)