Help Sorcerer Blitz! About thief

I use the sample code to define the thief
but it can’t steal runner or merger fruit

def collectHandler_th(data) :
unit = data.target
while True:
if unit.item:
unit.bring()
else:
nearest = unit.findNearestEnemy()
if nearest and nearest.item:
if unit.distanceTo(nearest) < 5:
unit.special(nearest)
else:
unit.move(nearest.pos)

hero.on(‘spawn-thief’, collectHandler_th)

Hello and welcome to the Code Combat discourse. :partying_face: We have some amazing people who would LOVE to help you with bugs, creating levels, and getting through levels. Don’t forget though, when you need help, create a new level, and format your code correctly Or, you can just chat with others in topics. Please go to this topic: here to see more details. We would be happy to just chat with you to! And I don’t think this is a bug so I have changed it to #level-help.

2 Likes

Hello @111116 , and welcome to the forum :partying_face: Hope you enjoy your time here!

Please, format your code using this button, it is way easier for us to help you, thanks:

1 Like