From 7f1d0a9c09fe616ebaffbd6590813f31e87bad5b Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Wed, 3 Jul 2024 12:42:09 +0800 Subject: [PATCH] Fix: Ornament task delayed dungeon task --- tasks/ornament/ornament.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/tasks/ornament/ornament.py b/tasks/ornament/ornament.py index 1d94fb35f..afbb71e9b 100644 --- a/tasks/ornament/ornament.py +++ b/tasks/ornament/ornament.py @@ -44,26 +44,24 @@ class Ornament(OrnamentCombat): # Check stamina logger.info('Check stamina') stamina = self.combat_get_trailblaze_power() - if stamina < self.combat_wave_cost: - logger.info('Current trailblaze power is not enough for a run') - self.delay_dungeon_task(self.dungeon) - self.config.task_stop() - if not self.config.Ornament_UseStamina and self.config.stored.DungeonDouble.rogue <= 0: + if self.config.Ornament_UseStamina: + if stamina < self.combat_wave_cost: + logger.info('Current trailblaze power is not enough for a run') + self.delay_dungeon_task(self.dungeon) + self.config.task_stop() + elif self.config.stored.DungeonDouble.rogue > 0: + if stamina < self.combat_wave_cost: + logger.info('Doing double rogue, current trailblaze power is not enough for a run') + self.delay_dungeon_task(self.dungeon) + self.config.task_stop() + else: if self.config.stored.Immersifier.value <= 0: logger.info('Current immersifier is not enough for a run') - self.delay_dungeon_task(self.dungeon) + self.config.task_delay(server_update=True) self.config.task_stop() return result - def delay_dungeon_task(self, dungeon: DungeonList): - with self.config.multi_set(): - super().delay_dungeon_task(dungeon) - if not self.config.Ornament_UseStamina and self.config.stored.DungeonDouble.rogue <= 0: - if self.config.stored.Immersifier.value <= 0: - logger.info('Immersifier exhausted') - self.config.task_delay(server_update=True) - def run(self): self.config.update_battle_pass_quests() self.config.update_daily_quests()