Fix: Storing immersifier didn't trigger stamina quest

This commit is contained in:
LmeSzinc 2024-01-12 23:54:37 +08:00
parent 69bc3b21c3
commit e1c8be79aa
2 changed files with 19 additions and 11 deletions

View File

@ -135,13 +135,7 @@ class Dungeon(DungeonStamina, DungeonEvent, Combat):
logger.info('Achieve daily quest Obtain_victory_in_combat_with_Support_Characters_1_times')
self.achieved_daily_quest = True
# Stamina quest
if KEYWORD_BATTLE_PASS_QUEST.Consume_a_total_of_1_Trailblaze_Power_1400_Trailblazer_Power_max in self.weekly_quests:
cost = self.combat_wave_cost * count
logger.info(f'Done Consume_a_total_of_1_Trailblaze_Power_1400_Trailblazer_Power_max stamina {cost}')
self.config.stored.BattlePassQuestTrailblazePower.add(cost)
if self.config.stored.BattlePassQuestTrailblazePower.is_full():
logger.info('Achieved weekly quest Consume_a_total_of_1_Trailblaze_Power_1400_Trailblazer_Power_max')
self.achieved_weekly_quest = True
self.check_stamina_quest(self.combat_wave_cost * count)
# Check trailblaze power, this may stop current task
if self.is_trailblaze_power_exhausted():
@ -321,7 +315,8 @@ class Dungeon(DungeonStamina, DungeonEvent, Combat):
and self.config.cross_get('Rogue.RogueWorld.DoubleEvent') \
and self.config.stored.DungeonDouble.rogue > 0:
amount = self.config.stored.DungeonDouble.rogue
self.immersifier_store(max_store=amount)
stored = self.immersifier_store(max_store=amount)
self.check_stamina_quest(stored * 40)
# call rogue task if accumulated to 4
with self.config.multi_set():
if self.config.stored.Immersifier.value >= 4:
@ -408,3 +403,13 @@ class Dungeon(DungeonStamina, DungeonEvent, Combat):
logger.attr('Require compulsory support', require)
return require
def check_stamina_quest(self, stamina_used: int):
if KEYWORD_BATTLE_PASS_QUEST.Consume_a_total_of_1_Trailblaze_Power_1400_Trailblazer_Power_max not in self.weekly_quests:
return
logger.info(f'Done Consume_a_total_of_1_Trailblaze_Power_1400_Trailblazer_Power_max stamina {stamina_used}')
self.config.stored.BattlePassQuestTrailblazePower.add(stamina_used)
if self.config.stored.BattlePassQuestTrailblazePower.is_full():
logger.info('Achieved weekly quest Consume_a_total_of_1_Trailblaze_Power_1400_Trailblazer_Power_max')
self.achieved_weekly_quest = True

View File

@ -130,7 +130,7 @@ class DungeonStamina(DungeonUI):
max_store: Maximum amount to store this time
Returns:
bool: If stored any
int: Amount stored
Pages:
in: Any
@ -140,6 +140,7 @@ class DungeonStamina(DungeonUI):
logger.info(f'Max store: {max_store}')
self.dungeon_goto_rogue()
self.dungeon_update_stamina()
before = self.config.stored.Immersifier.value
if self.config.stored.Immersifier.is_full():
logger.info('Immersifier full, cannot store more')
@ -152,10 +153,12 @@ class DungeonStamina(DungeonUI):
amount = min(amount, max_store)
if amount <= 0:
logger.info('Not enough stamina to store 1 immersifier')
return False
return 0
self._immersifier_enter()
self._item_amount_set(amount, ocr_button=OCR_IMMERSIFIER_AMOUNT)
self._item_confirm()
self.dungeon_update_stamina()
return True
diff = self.config.stored.Immersifier.value - before
logger.info(f'Stored {diff} immersifiers')
return diff