I am on clash of clones ive been stuck on it for almost a month my hero used to survive then he would go for a sand yak and get killed by it now he dies cause of the enemy troops and knight/ogres i have 1935 health please help me.
loop:
enemyIndex = 0
enemies = self.findEnemies()
while enemyIndex < len(enemies) and self.health > self.maxHealth / 4:
enemy = enemies[enemyIndex]
enemyIndex += 1
if enemy.type != 'sand-yak':
while enemy.health > 0:
if self.isReady("cleave"):
self.cleave(enemy)
else:
self.attack(enemy)
if self.health <= self.maxHealth / 4:
enemy = enemies[enemyIndex]
distance = self.distanceTo(enemy)
enemyIndex += 1
if distance > 2:
if self.isReady("cleave"):
self.cleave(enemy)
else:
self.attack(enemy)
Honestly, there isn’t anything wrong with your code at all. You could always try a different strategy. For example, the enemy hero has a very basic program: Look for enemy. If enemy, attack. The clone will not bash or use any other special attacks. What do you think would happen when you don’t equip a weapon? Remember that the clone has the exact same gear as you do.
Well, you’ll notice that your clone doesn’t do anything. You’ve just gotten rid of the most powerful enemy. Now, do you have a bashing shield, e.g Steel Striker?
when defining your enemy/target variable, you should ensure that you are not allowing the script to select a yak. Also be careful with Cleave, as it is an area attack. If you’re standing to close too a Yak and you attempt to cleave. There will be trouble. (I used a sword with a power-up instead of a cleave weapon)