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

View File

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

View File

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