mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-30 00:27:14 +08:00
Opt: Raise error when emotion set wrong
This commit is contained in:
@@ -6,7 +6,7 @@ import numpy as np
|
|||||||
from module.base.decorator import cached_property
|
from module.base.decorator import cached_property
|
||||||
from module.base.utils import random_normal_distribution_int
|
from module.base.utils import random_normal_distribution_int
|
||||||
from module.config.config import AzurLaneConfig
|
from module.config.config import AzurLaneConfig
|
||||||
from module.exception import ScriptEnd, ScriptError
|
from module.exception import ScriptEnd, ScriptError, RequestHumanTakeover
|
||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
|
|
||||||
DIC_LIMIT = {
|
DIC_LIMIT = {
|
||||||
@@ -128,6 +128,11 @@ class FleetEmotion:
|
|||||||
datetime.datetime: When will emotion >= control limit.
|
datetime.datetime: When will emotion >= control limit.
|
||||||
If already recovered, return time in the past.
|
If already recovered, return time in the past.
|
||||||
"""
|
"""
|
||||||
|
if self.control == 'keep_exp_bonus' and self.recover == 'not_in_dormitory':
|
||||||
|
logger.critical(f'Fleet {self.fleet} Emotion Control=\"Keep Happy Bonus\" and '
|
||||||
|
f'Fleet {self.fleet} Recover Location=\"Docks\" can not be used together, '
|
||||||
|
'please check your emotion settings')
|
||||||
|
raise RequestHumanTakeover
|
||||||
recover_count = (self.limit + expected_reduce - self.current) // self.speed
|
recover_count = (self.limit + expected_reduce - self.current) // self.speed
|
||||||
recovered = (int(datetime.now().timestamp()) // 360 + recover_count + 1) * 360
|
recovered = (int(datetime.now().timestamp()) // 360 + recover_count + 1) * 360
|
||||||
return datetime.fromtimestamp(recovered)
|
return datetime.fromtimestamp(recovered)
|
||||||
|
|||||||
Reference in New Issue
Block a user