I was wondering why my code does not work in the level “The One Wizard” (Forest).
while True:
enemy = hero.findNearestEnemy()
if enemy:
if hero.canCast("chain-lightning"):
hero.cast("chain-lightning", enemy)
elif enemy:
if hero.canCast("lightning-bolt"):
hero.cast("lightning-bolt", enemy)
elif enemy:
if hero.canCast("root"):
hero.cast("root", enemy)
elif hero.maxHealth < 82.5:
if hero.canCast("regen", hero):
hero.cast("lightning-bolt", hero)
elif enemy:
hero.attack(enemy)
else:
hero.moveXY(14, 34)
For some reason the hero is stuck at “if hero.canCast(“chain-lightning”):” after the first time she used chain lightning. Shouldn’t “False” be returned after the first time chain lightning was used and go on to the next elif (lightning bolt)? Thanks for your help!