Skip to content

Commit

Permalink
添加有两个以上治疗角色无法自动战斗提示
Browse files Browse the repository at this point in the history
  • Loading branch information
ok-oldking committed Oct 19, 2024
1 parent ebe08ff commit 89fbbd2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
Binary file modified i18n/zh_CN/LC_MESSAGES/ok.mo
Binary file not shown.
5 changes: 4 additions & 1 deletion i18n/zh_CN/LC_MESSAGES/ok.po
Original file line number Diff line number Diff line change
Expand Up @@ -388,4 +388,7 @@ msgid "Auto Login Success"
msgstr "自动登录成功"

msgid "Must choose at least 2 Boss to Farm"
msgstr "必须至少选择两个Boss"
msgstr "必须至少选择两个Boss"

msgid "Can not auto combat because team can only have one healer at most"
msgstr "无法自动战斗, 队伍最多只能有一个治疗角色"
4 changes: 3 additions & 1 deletion src/char/BaseChar.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def click_liberation(self, con_less_than=-1, send_click=False, wait_if_cd_ready=
self.logger.info(f'click_liberation end {duration}')
return clicked

def add_freeze_duration(self, start, duration=-1, freeze_time=0.2):
def add_freeze_duration(self, start, duration=-1, freeze_time=0.1):
if duration == -1:
duration = time.time() - start
if start > 0 and duration > freeze_time:
Expand All @@ -294,6 +294,8 @@ def time_elapsed_accounting_for_freeze(self, start):
for freeze_start, duration, freeze_time in self.freeze_durations:
if start < freeze_start:
to_minus += duration - freeze_time
if to_minus != 0:
self.logger.debug(f'time_elapsed_accounting_for_freeze to_minus {to_minus}')
return time.time() - start - to_minus

def get_liberation_key(self):
Expand Down
4 changes: 3 additions & 1 deletion src/char/Encore.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def can_resonance_step2(self, delay=2):
return self.time_elapsed_accounting_for_freeze(self.last_resonance) < delay

def do_get_switch_priority(self, current_char: BaseChar, has_intro=False, target_low_con=False):
if self.time_elapsed_accounting_for_freeze(self.last_heavy) < 4:
self.logger.debug(
f'encore last heavy time {self.last_heavy} {self.time_elapsed_accounting_for_freeze(self.last_heavy)}')
if self.time_elapsed_accounting_for_freeze(self.last_heavy) < 4.5:
return Priority.MIN
elif self.still_in_liberation() or self.can_resonance_step2():
self.logger.info(
Expand Down
7 changes: 7 additions & 0 deletions src/task/BaseCombatTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from src.char import BaseChar
from src.char.BaseChar import Priority, dot_color
from src.char.CharFactory import get_char_by_pos
from src.char.Healer import Healer
from src.combat.CombatCheck import CombatCheck
from src.task.BaseWWTask import BaseWWTask

Expand Down Expand Up @@ -349,13 +350,19 @@ def load_chars(self):
self.chars = self.chars[:2]
logger.info(f'team size changed to 2')

healer_count = 0
for char in self.chars:
if char is not None:
char.reset_state()
if isinstance(char, Healer):
healer_count += 1
if char.index == current_index:
char.is_current_char = True
else:
char.is_current_char = False
if healer_count >= 2:
self.log_error(f"Can not auto combat because team can only have one healer at most", notify=True, tray=True)
self.pause()
self.combat_start = time.time()

self.log_info(f'load chars success {self.chars}')
Expand Down

0 comments on commit 89fbbd2

Please sign in to comment.