Fix: BattlePass should prior to DailyQuest so it can be called

This commit is contained in:
LmeSzinc 2024-06-15 03:36:47 +08:00
parent 2149803179
commit 726a829e89
3 changed files with 31 additions and 11 deletions

View File

@ -511,13 +511,11 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
TaskEnd: Call task `DailyQuest` and stop current task
"""
if self.stored.DailyActivity.is_expired():
logger.info('DailyActivity expired, call task to update')
self.task_call('DailyQuest')
self.task_stop()
logger.info('DailyActivity expired')
self.stored.DailyActivity.clear()
if self.stored.DailyQuest.is_expired():
logger.info('DailyQuest expired, call task to update')
self.task_call('DailyQuest')
self.task_stop()
logger.info('DailyQuest expired')
self.stored.DailyQuest.clear()
def update_battle_pass_quests(self):
"""
@ -528,9 +526,8 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
if self.stored.BattlePassLevel.is_full():
logger.info('BattlePassLevel full, no updates')
else:
logger.info('BattlePassTodayQuest expired, call task to update')
self.task_call('BattlePass')
self.task_stop()
logger.info('BattlePassTodayQuest expired')
self.stored.BattlePassWeeklyQuest.clear()
@property
def DEVICE_SCREENSHOT_METHOD(self):

View File

@ -11,7 +11,7 @@ class ManualConfig:
SCHEDULER_PRIORITY = """
Restart
> Weekly > Dungeon > Assignment
> DailyQuest > BattlePass
> BattlePass > DailyQuest
> Freebies > DataUpdate
> Rogue
"""

View File

@ -132,6 +132,9 @@ class StoredExpiredAtMonday0400(StoredBase):
class StoredInt(StoredBase):
value = 0
def clear(self):
self.value = 0
class StoredCounter(StoredBase):
value = 0
@ -146,6 +149,9 @@ class StoredCounter(StoredBase):
self.value = value
self.total = total
def clear(self):
self.value = 0
def to_counter(self) -> str:
return f'{self.value}/{self.total}'
@ -283,6 +289,14 @@ class StoredDaily(StoredCounter, StoredExpiredAt0400):
except IndexError:
self.quest6 = ''
def clear(self):
self.quest1 = ''
self.quest2 = ''
self.quest3 = ''
self.quest4 = ''
self.quest5 = ''
self.quest6 = ''
class StoredDungeonDouble(StoredExpiredAt0400):
calyx = 0
@ -298,7 +312,7 @@ class StoredBattlePassLevel(StoredCounter):
FIXED_TOTAL = 70
class StoredBattlePassWeeklyQuest(StoredCounter, StoredExpiredAt0400):
class StoredBattlePassWeeklyQuest(StoredCounter, StoredExpiredAtMonday0400):
quest1 = ''
quest2 = ''
quest3 = ''
@ -365,6 +379,15 @@ class StoredBattlePassWeeklyQuest(StoredCounter, StoredExpiredAt0400):
except IndexError:
self.quest7 = ''
def clear(self):
self.quest1 = ''
self.quest2 = ''
self.quest3 = ''
self.quest4 = ''
self.quest5 = ''
self.quest6 = ''
self.quest7 = ''
class StoredBattlePassSimulatedUniverse(StoredCounter):
FIXED_TOTAL = 1