diff --git a/src/char/BaseChar.py b/src/char/BaseChar.py index b54bcb60..d588ebcd 100644 --- a/src/char/BaseChar.py +++ b/src/char/BaseChar.py @@ -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 @@ -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: diff --git a/src/char/Carlotta.py b/src/char/Carlotta.py index 31f4905d..5b57e4bb 100644 --- a/src/char/Carlotta.py +++ b/src/char/Carlotta.py @@ -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() diff --git a/src/char/CharFactory.py b/src/char/CharFactory.py index 97b7b9f5..d7c5b19b 100644 --- a/src/char/CharFactory.py +++ b/src/char/CharFactory.py @@ -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