Fix: Assume daily quests if it's expired

This commit is contained in:
LmeSzinc 2024-07-19 02:00:01 +08:00
parent 650664ca3d
commit bd86564fd7
3 changed files with 29 additions and 4 deletions

View File

@ -715,7 +715,9 @@
"quest4": "", "quest4": "",
"quest5": "", "quest5": "",
"quest6": "", "quest6": "",
"total": 6, "quest7": "",
"quest8": "",
"total": 8,
"value": 0 "value": 0
}, },
"order": 0, "order": 0,

View File

@ -516,7 +516,17 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
self.stored.DailyActivity.clear() self.stored.DailyActivity.clear()
if self.stored.DailyQuest.is_expired(): if self.stored.DailyQuest.is_expired():
logger.info('DailyQuest expired') logger.info('DailyQuest expired')
self.stored.DailyQuest.clear() q = self.stored.DailyQuest
q.clear()
# Assume fixed quests
q.write_quests([
'Complete_1_Daily_Mission',
'Log_in_to_the_game',
'Dispatch_1_assignments',
'Complete_Divergent_Universe_or_Simulated_Universe_1_times',
'Obtain_victory_in_combat_with_Support_Characters_1_times',
'Consume_120_Trailblaze_Power',
])
def update_battle_pass_quests(self): def update_battle_pass_quests(self):
""" """

View File

@ -234,8 +234,10 @@ class StoredDaily(StoredCounter, StoredExpiredAt0400):
quest4 = '' quest4 = ''
quest5 = '' quest5 = ''
quest6 = '' quest6 = ''
quest7 = ''
quest8 = ''
FIXED_TOTAL = 6 FIXED_TOTAL = 8
def load_quests(self): def load_quests(self):
""" """
@ -245,7 +247,8 @@ class StoredDaily(StoredCounter, StoredExpiredAt0400):
# DailyQuest should be lazy loaded # DailyQuest should be lazy loaded
from tasks.daily.keywords import DailyQuest from tasks.daily.keywords import DailyQuest
quests = [] quests = []
for name in [self.quest1, self.quest2, self.quest3, self.quest4, self.quest5, self.quest6]: for name in [self.quest1, self.quest2, self.quest3, self.quest4,
self.quest5, self.quest6, self.quest7, self.quest8]:
if not name: if not name:
continue continue
try: try:
@ -288,6 +291,14 @@ class StoredDaily(StoredCounter, StoredExpiredAt0400):
self.quest6 = quests[5] self.quest6 = quests[5]
except IndexError: except IndexError:
self.quest6 = '' self.quest6 = ''
try:
self.quest7 = quests[6]
except IndexError:
self.quest7 = ''
try:
self.quest8 = quests[7]
except IndexError:
self.quest8 = ''
def clear(self): def clear(self):
with self._config.multi_set(): with self._config.multi_set():
@ -297,6 +308,8 @@ class StoredDaily(StoredCounter, StoredExpiredAt0400):
self.quest4 = '' self.quest4 = ''
self.quest5 = '' self.quest5 = ''
self.quest6 = '' self.quest6 = ''
self.quest7 = ''
self.quest8 = ''
class StoredDungeonDouble(StoredExpiredAt0400): class StoredDungeonDouble(StoredExpiredAt0400):