Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Can't pass cursed valley


to pass this level i need to kill 3 skeletons and stay alive. But my hero just can’t stay alive until the second skeleton shows up , even though he has drunk the potion
here’s my code:

while True:
enemies = hero.findEnemies()
if enemies:
for enemy in enemies:
if == ‘ogres’ and enemy.type == ‘skeleton’:

item = hero.findNearest(hero.findItems())
if item and item.type == 'potion' and < hero.maxHealth/4:
    hero.moveXY(item.pos.x, item.pos.y)


Could you show what the equipment you are using? (just a screenshot). I will try to reproduce it.




Are you using “chain-lightning” for that level?


No, just hero.attack()



can you send us an email at so that we can look over your session and see what may be wrong?


sure, thanks for your time


Sorry for the delay. Could you try it now? There was a problem with one of component changing and I made some rebalance things. Please tell me if you failure or success that level.


Thanks, finally it works fine.


Thanks ,i passed it . it works fine now. but i find another problem on another level… i tell u about it in a new post


Maybe there’s a new bug, but I can’t pass this either. I see three skeletons get killed, but it continues anyway and eventually fails because it times out. Here’s my code…

[Solution is correct, so it's removed]



@AttackArmy Your code looks correct and I checked it with my hero - no problems. Could you sent me with direct messages your CodeCombat username or to the email I will look at your game replay and try to find a problem.


Thanks for looking into it. It seemed very odd that it wasn’t completing. Here’s my user name…


Thanks. I see a problem, but not see where it is. Give me please some time to find it.


Ha! It was interesting. The “problem” was in “samurai + High tier damage sword”. As the result, your hero can kill a skeleton with one hit (411 damage in one hit). The level’s referee could not process that case.

Not it’s fixed (I changed the referee logic). Could you try it again? Please, use the direct link if you still have the same problem.

Thank you very much for the feedback - without it some players could stuck on this level and leave.