mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-26 18:20:42 +00:00
Fix: 修复调用错误心情对象的问题
This commit is contained in:
parent
f327ef0027
commit
f32042fbd2
@ -24,6 +24,7 @@ class CampaignRun(CampaignUI, Reward, LoginHandler):
|
||||
config: AzurLaneConfig
|
||||
campaign: CampaignBase
|
||||
run_count: int
|
||||
start_time = datetime.now()
|
||||
|
||||
def load_campaign(self, name, folder='campaign_main'):
|
||||
"""
|
||||
@ -103,6 +104,30 @@ class CampaignRun(CampaignUI, Reward, LoginHandler):
|
||||
|
||||
return False
|
||||
|
||||
def _triggered_app_restart(self):
|
||||
"""
|
||||
Returns:
|
||||
bool: If triggered a restart condition.
|
||||
"""
|
||||
now = datetime.now()
|
||||
if now.date() != self.start_time.date():
|
||||
logger.hr('Triggered restart new day')
|
||||
return True
|
||||
if not self.campaign.config.IGNORE_LOW_EMOTION_WARN:
|
||||
if self.campaign.emotion.triggered_bug():
|
||||
logger.hr('Triggered restart avoid emotion bug')
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def handle_app_restart(self):
|
||||
if self._triggered_app_restart():
|
||||
self.app_restart()
|
||||
self.start_time = datetime.now()
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def run(self, name, folder='campaign_main', total=0):
|
||||
"""
|
||||
Args:
|
||||
|
@ -114,6 +114,7 @@ class Emotion:
|
||||
The game does not calculate emotion correctly, which is a bug in AzurLane.
|
||||
After a long run, we have to restart the game to update it.
|
||||
"""
|
||||
logger.attr('Emotion_bug', f'{self.total_reduced}/{self.BUG_THRESHOLD}')
|
||||
if self.total_reduced >= self.BUG_THRESHOLD:
|
||||
self.total_reduced = 0
|
||||
return True
|
||||
|
@ -2,13 +2,10 @@ from module.base.timer import Timer
|
||||
from module.combat.combat import Combat
|
||||
from module.handler.assets import *
|
||||
from module.logger import logger
|
||||
from datetime import datetime
|
||||
from module.ui.ui import MAIN_CHECK, EVENT_LIST_CHECK, BACK_ARROW
|
||||
|
||||
|
||||
class LoginHandler(Combat):
|
||||
start_time = datetime.now()
|
||||
|
||||
def handle_app_login(self):
|
||||
logger.hr('App login')
|
||||
|
||||
@ -54,27 +51,3 @@ class LoginHandler(Combat):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def _triggered_app_restart(self):
|
||||
"""
|
||||
Returns:
|
||||
bool: If triggered a restart condition.
|
||||
"""
|
||||
now = datetime.now()
|
||||
if now.date() != self.start_time.date():
|
||||
logger.hr('Triggered restart new day')
|
||||
return True
|
||||
if not self.config.IGNORE_LOW_EMOTION_WARN:
|
||||
if self.emotion.triggered_bug():
|
||||
logger.hr('Triggered restart avoid emotion bug')
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def handle_app_restart(self):
|
||||
if self._triggered_app_restart():
|
||||
self.app_restart()
|
||||
self.start_time = datetime.now()
|
||||
return True
|
||||
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user