Skip to content

Commit

Permalink
优化科莱塔
Browse files Browse the repository at this point in the history
  • Loading branch information
ok-oldking committed Jan 2, 2025
1 parent 2012bfd commit ef9cca8
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/char/BaseChar.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def reset_state(self):
self.logger.info('reset state')
self.has_intro = False

def click_liberation(self, con_less_than=-1, send_click=False, wait_if_cd_ready=0):
def click_liberation(self, con_less_than=-1, send_click=False, wait_if_cd_ready=0, timeout=5):
if con_less_than > 0:
if self.get_current_con() > con_less_than:
return False
Expand All @@ -252,7 +252,7 @@ def click_liberation(self, con_less_than=-1, send_click=False, wait_if_cd_ready=
self.liberation_available_mark = False
clicked = True
last_click = now
if time.time() - start > 5:
if time.time() - start > timeout:
self.task.raise_not_in_combat('too long clicking a liberation')
self.task.next_frame()
if clicked:
Expand Down
16 changes: 15 additions & 1 deletion src/char/Carlotta.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,18 @@

class Carlotta(BaseChar):

pass
def do_perform(self):
if self.has_intro:
self.logger.debug('has_intro wait click 1.2 sec')
self.continues_normal_attack(1.2, click_resonance_if_ready_and_return=True)
while self.click_liberation(con_less_than=1):
continue
if self.click_resonance()[0]:
return self.switch_next_char()
if self.is_forte_full():
self.heavy_attack(0.6)
return self.switch_next_char()
if self.click_echo():
return self.switch_next_char()
self.continues_normal_attack(0.31)
self.switch_next_char()
48 changes: 24 additions & 24 deletions src/char/CharFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,30 @@

def get_char_by_pos(task, box, index):
char_dict = {
'char_yinlin': {'cls': Yinlin, 'res_cd': 12, 'echo_cd': 15},
'char_verina': {'cls': Verina, 'res_cd': 12, 'echo_cd': 20},
'char_shorekeeper': {'cls': ShoreKeeper, 'res_cd': 15, 'echo_cd': 20},
'char_taoqi': {'cls': Taoqi, 'res_cd': 15, 'echo_cd': 20},
'char_rover': {'cls': HavocRover, 'res_cd': 12, 'echo_cd': 20},
'char_rover_male': {'cls': HavocRover, 'res_cd': 12, 'echo_cd': 20},
'char_encore': {'cls': Encore, 'res_cd': 10, 'echo_cd': 20},
'char_jianxin': {'cls': Jianxin, 'res_cd': 12, 'echo_cd': 20},
'char_sanhua': {'cls': Sanhua, 'res_cd': 10, 'echo_cd': 20},
'char_jinhsi': {'cls': Jinhsi, 'res_cd': 3, 'echo_cd': 20},
'char_jinhsi2': {'cls': Jinhsi, 'res_cd': 3, 'echo_cd': 20},
'char_yuanwu': {'cls': Yuanwu, 'res_cd': 3, 'echo_cd': 20},
'chang_changli': {'cls': Changli, 'res_cd': 12, 'echo_cd': 20},
'char_chixia': {'cls': Chixia, 'res_cd': 9, 'echo_cd': 20},
'char_danjin': {'cls': Danjin, 'res_cd': 9999999, 'echo_cd': 20},
'char_baizhi': {'cls': Baizhi, 'res_cd': 16, 'echo_cd': 20},
'char_calcharo': {'cls': Calcharo, 'res_cd': 99999, 'echo_cd': 20},
'char_jiyan': {'cls': Jiyan, 'res_cd': 16, 'echo_cd': 20},
'char_mortefi': {'cls': Mortefi, 'res_cd': 14, 'echo_cd': 20},
'char_zhezhi': {'cls': Zhezhi, 'res_cd': 6, 'echo_cd': 20},
'char_xiangliyao': {'cls': Xiangliyao, 'res_cd': 5, 'echo_cd': 20},
'char_camellya': {'cls': Camellya, 'res_cd': 4, 'echo_cd': 20},
'char_youhu': {'cls': Youhu, 'res_cd': 4, 'echo_cd': 20},
'char_carlotta': {'cls': Carlotta, 'res_cd': 10, 'echo_cd': 20},
'char_yinlin': {'cls': Yinlin, 'res_cd': 12, 'echo_cd': 25},
'char_verina': {'cls': Verina, 'res_cd': 12, 'echo_cd': 25},
'char_shorekeeper': {'cls': ShoreKeeper, 'res_cd': 15, 'echo_cd': 25},
'char_taoqi': {'cls': Taoqi, 'res_cd': 15, 'echo_cd': 25},
'char_rover': {'cls': HavocRover, 'res_cd': 12, 'echo_cd': 25},
'char_rover_male': {'cls': HavocRover, 'res_cd': 12, 'echo_cd': 25},
'char_encore': {'cls': Encore, 'res_cd': 10, 'echo_cd': 25},
'char_jianxin': {'cls': Jianxin, 'res_cd': 12, 'echo_cd': 25},
'char_sanhua': {'cls': Sanhua, 'res_cd': 10, 'echo_cd': 25},
'char_jinhsi': {'cls': Jinhsi, 'res_cd': 3, 'echo_cd': 25},
'char_jinhsi2': {'cls': Jinhsi, 'res_cd': 3, 'echo_cd': 25},
'char_yuanwu': {'cls': Yuanwu, 'res_cd': 3, 'echo_cd': 25},
'chang_changli': {'cls': Changli, 'res_cd': 12, 'echo_cd': 25},
'char_chixia': {'cls': Chixia, 'res_cd': 9, 'echo_cd': 25},
'char_danjin': {'cls': Danjin, 'res_cd': 9999999, 'echo_cd': 25},
'char_baizhi': {'cls': Baizhi, 'res_cd': 16, 'echo_cd': 25},
'char_calcharo': {'cls': Calcharo, 'res_cd': 99999, 'echo_cd': 25},
'char_jiyan': {'cls': Jiyan, 'res_cd': 16, 'echo_cd': 25},
'char_mortefi': {'cls': Mortefi, 'res_cd': 14, 'echo_cd': 25},
'char_zhezhi': {'cls': Zhezhi, 'res_cd': 6, 'echo_cd': 25},
'char_xiangliyao': {'cls': Xiangliyao, 'res_cd': 5, 'echo_cd': 25},
'char_camellya': {'cls': Camellya, 'res_cd': 4, 'echo_cd': 25},
'char_youhu': {'cls': Youhu, 'res_cd': 4, 'echo_cd': 25},
'char_carlotta': {'cls': Carlotta, 'res_cd': 10, 'echo_cd': 25},
}
highest_confidence = 0
info = None
Expand Down

0 comments on commit ef9cca8

Please sign in to comment.