I’ve been trying to get this done for a long time, and I still cannot solve it. I’ve been attempting to attack the archers, but my character doesn’t do it; I’ve tried bashing and electrocuting, but it has yet to help beat the enemy; I’ve tried going after my own clone, but even that lands me dead via archers.
My code:
# You'll need good strategy to win this one!
# Your clone will have the same equipment you have!
# But, they're not very skilled at using special powers.
while True:
enemy = hero.findNearestEnemy()
target = enemy
archer = enemy
if enemy.type == "Robin":
hero.bash(target)
else:
hero.attack(enemy)
I’ve tried if enemy.type == "archers"
and that hasn’t worked either. Even when I move closer it ignores the archer’s existence.
Hello! There are a few things I’d like to say about Clash of Clones.
Remember that the clone has the copy of your armour. So I would recommend using special abilities that clone can’t use. For example, you could use some abilities from rings (if you have any), gloves (like chain-lightning, works very well in that level), even cleave (if you cleave the archers, it can help you very much). Don’t worry about your low damage if you are using cleave because the clone will also be weak (and he won’t be able to use the “cleave” ability). Also, it would be great if you share your equipment (maybe people here would suggest you something depending on the items you have).
About your code, if you want to define the archers, you should write this: if enemy.type == "archer"
since you can kill one archer, not the whole array.
If you want to use this kind of strategy, you won’t bash the archers unless you stand near them (I will give you an alternative way later in this post) because the enemy is your nearest enemy and in the beginning of the level all the enemies that are near you are the soldiers, so you will start bashing archers only after killing every enemy soldier.
An alternative way is a bit harder than the one you started with. Since you are trying to solve this level, I am pretty sure that you completed all the levels in the Desert, so you know how to write functions which choose best items (not needed in your case) and enemies. If your strategy does not work, I can try to explain you how to use it here.
Ping me if you have any questions.
P.S. I will change this topic’s category to “Level Help” because I guess that’s what this topic is meant for.
Thanks for sharing the equipment, I would recommend you moving where the enemy archers stand and cleaving there before the loop. Then you can start attacking and bashing the enemies and see what happens next.
Hasn’t been working.
enemy = hero.findNearestEnemy()
target = enemy
archer = enemy
hero.moveXY(50, 90)
hero.moveXY(75, 93)
hero.moveXY(82, 73)
hero.cleave(enemy)
while True:
if enemy.type == "archer":
hero.cleave(enemy)
if enemy:
hero.bash(enemy)
else:
hero.cleave(enemy)
Since bash and cleave functions have a cooldown, you should check if your hero is ready to do the command.
For example:
if hero.isReady("cleave"):
hero.cleave(enemy)
Still not working.
enemy = hero.findNearestEnemy()
target = enemy
archer = enemy
hero.moveXY(50, 90)
hero.moveXY(75, 93)
hero.moveXY(82, 73)
if hero.isReady("cleave"):
hero.cleave(enemy)
while True:
if enemy:
if hero.isReady("bash"):
hero.bash(enemy)
else:
if hero.isReady("cleave"):
hero.cleave(enemy)
Try putting “else” against the isReady("bash) part. And also you need to attack the enemies if none of your special abilities are ready.
Because right now you will cleave only if there is no enemy which is just not possible. But if you put that “else” part there. And attacking is essential.
Also I forgot to tell you: you should define the enemy in the loo (and to cleave in the beginning you don’t need to cleave(enemy), you can just leave hero.cleave()
Still not working. Did I do it wrong?
enemy = hero.findNearestEnemy()
target = enemy
archer = enemy
hero.moveXY(50, 90)
hero.moveXY(75, 93)
hero.moveXY(82, 73)
if hero.isReady("cleave"):
hero.cleave(enemy)
while True:
enemy = hero.findNearestEnemy()
if enemy:
hero.attack(enemy)
else:
if hero.isReady("bash"):
hero.bash()
if hero.isReady("cleave"):
hero.cleave()
Oh, just delete the else and it should work.
No, deletion of the else doesn’t seem to help.
The same old thing happens. I move around to the archers, then move back away without cleaving them, and then get shot down and killed. Then the clones run over the rest of my army.
you need a target for bash and cleave I think
Tried that. It doesn’t go for the archers when I tell it too
You need the findNearestEnemy() to be before you move over to the archers; as it’s probably trying to target a soldier in the front
1 Like
Yet again, it does not work.
enemy = hero.findNearestEnemy()
target = enemy
archer = enemy
while True:
enemy = hero.findNearestEnemy()
hero.moveXY(50, 90)
hero.moveXY(75, 93)
hero.moveXY(82, 73)
if hero.isReady("cleave"):
hero.cleave(enemy)
while True:
enemy = hero.findNearestEnemy()
if enemy:
hero.attack(enemy)
else:
if hero.isReady("bash"):
hero.bash()
if hero.isReady("cleave"):
hero.cleave()
you need to put the findNearestEnemy() after you move to the archers
the findNearestEnemy() is finding the soldiers at the start and then trying to cleave them even after you move to the archers.
Erm skill iss-
Kk try using minimal gear (with abilities) use a cleave sword only…no armor. Cleave the opponents archers and let your archers deal with the opponent