# Follow me on youtube channel Phy Tu
# Help with programming on Python, school math, physics
# https://www.youtube.com/channel/UCP5ycahCEZ24qmRRgNnko5Q
# First, loop through all enemies...
enemies = hero.findEnemies()
enemyIndex = 0
# ... but only attack "thrower" type enemies.
while enemyIndex < len(enemies):
enemy = enemies[enemyIndex]
if enemy and enemy.type == "thrower":
hero.attack(enemy)
enemyIndex += 1
# Then loop through all the enemies again...
enemies = hero.findEnemies()
enemyIndex = 0
# ... and defeat everyone who's still standing.
while enemyIndex<len(enemies):
enemy=enemies[enemyIndex]
if enemy:
hero.attack(enemy)
enemyIndex+=1