loop {
var enemy = hero.findNearestEnemy();
if(enemy) {
// Определи расстояние до противника с помощью distanceTo.
var distance = this.distanceTo(enemy);
// Если дистанция меньше 5 метров …
if (distance<5) {
// … если рассечение (“cleave”) готово, руби!
if (this.isReady(“cleave”)) {
this.cleave(enemy);
// … или же просто атакуй.
} else {
this.attack(enemy);
}
}
}
}
Ok, I managed to beat the level with out the shield. I lost 166pt of health.
while(true) {
var enemy = this.findNearestEnemy(); //get enemy
if(enemy) { //if there is an enemy
var dist = this.distanceTo(enemy); //find distance to enemy
if(dist < 5 && this.isReady("cleave")) { //if dist. is less than 5 AND! cleave is ready
this.cleave(enemy); //use cleave
} else { //if either of the two if statements are: false
hero.attack(enemy); //normaly attack
}
}
}
From my testing at least I have found that using the this.sheild(); usually actually causes me more damage. I did not really do anything different than you, so maybe you just need some more armor? How much protection do you have?