Fix: Trailblaze power extract should before setting waves

This commit is contained in:
LmeSzinc 2024-08-26 22:33:06 +08:00
parent 1c914a8854
commit 6044946b7b

View File

@ -31,8 +31,15 @@ class Combat(CombatInteract, CombatPrepare, CombatState, CombatTeam, CombatSuppo
in: COMBAT_PREPARE in: COMBAT_PREPARE
""" """
self.combat_waves = 1 self.combat_waves = 1
current = self.combat_get_trailblaze_power()
cost = self.combat_get_wave_cost() cost = self.combat_get_wave_cost()
if self.config.stored.TrailblazePower.value < self.combat_wave_cost:
if self._try_get_more_trablaize_power(self.combat_wave_cost):
current = self.config.stored.TrailblazePower.value
else:
return False
else:
current = self.combat_get_trailblaze_power()
if cost == 10: if cost == 10:
# Calyx # Calyx
self.combat_waves = min(current // self.combat_wave_cost, 6) self.combat_waves = min(current // self.combat_wave_cost, 6)
@ -54,7 +61,7 @@ class Combat(CombatInteract, CombatPrepare, CombatState, CombatTeam, CombatSuppo
# Check limits # Check limits
if self.config.stored.TrailblazePower.value < self.combat_wave_cost: if self.config.stored.TrailblazePower.value < self.combat_wave_cost:
return self._try_get_more_trablaize_power(self.combat_wave_cost) return False
if self.combat_waves <= 0: if self.combat_waves <= 0:
logger.info('Combat wave limited, cannot continue combat') logger.info('Combat wave limited, cannot continue combat')
return False return False