Hello all. I am playing kithgard Brawl. My code seems to work fine at the beginning, but after 15 seconds, my hero stop attacking enemies for a while. Importantly, this happens before the medicine appears. Any ideas?
loop:
enemy = self.findNearestEnemy()
item = self.findNearestItem()
if item:
position = item.pos
x = position.x
y = position.y
if self.health < 200:
self.moveXY(x, y)
elif enemy:
distance = self.distanceTo(enemy)
if distance < 5 and self.isReady("cleave"):
self.cleave(enemy)
elif enemy.type is "ogre" and self.isReady("bash"):
self.bash(enemy)
else:
self.attack(enemy)