def attack_hero(attacker): """Attack the defending hero. Don't wait for animation here because no status updates will occur. Except for secrets - we want to check if one exists before waiting for it to trigger. Store a secret object locally. If we attack, and nothing happens (secret still there), move at full pace. If the secret triggers, wait, then move at full pace anyway. """ my_num_minions = len(gstate.tingle.minions) control.my_click_on_minion(my_num_minions, int(attacker.pos)) control.click_opponent_hero()
def attack_minion(attacker, defender): """Use the attacking minion to attack the defending one. Wait for kill animation to end, as gstate needs to update minion count. """ logger.info("Attack {} -> {}".format(attacker, defender)) my_num_minions = len(gstate.tingle.minions) their_num_minions = len(gstate.opponent.minions) assert my_num_minions assert their_num_minions assert attacker.zone == "PLAY" assert defender.zone == "PLAY" control.my_click_on_minion(my_num_minions, int(attacker.pos)) control.opponent_click_on_minion(their_num_minions, int(defender.pos)) time.sleep(2)