I’ve just tried playing the sorcerer for the first time… and I’m stuck already.
I don’t get any errors, so it must be my logic. The strange thing is that the code to heal my troops was provided to me by the game, yet my hero doesn’t heal or attack.
Anyone know what I’m doing wrong?
loop;
{
if (this.canCast("regen")) {
var bernardDistance = this.distanceTo("Bernard");
if (bernardDistance < 10) {
this.cast("regen", "Bernard");
}
var chandraDistance = this.distanceTo("Chandra");
if (chandraDistance < 10) {
this.cast("regen", "Chandra");
}
} else {
var enemy = this.findNearest(this.findEnemies());
if (enemy) {
if (this.distanceTo(enemy) < this.attackRange) {
this.attack(enemy);
}
}
}
}