[SOLVED] Doom glade - can't finish level

Hi everyone, I’m currently stuck in the above mentioned level. It doesn’t seem that my code is wrong, it is more that my hero’s are not strong enough.
Is there a master solution for the level, with regards to the hero and weapon’s I have to use?
Btw my hero Alejandro has 997 health and my strongest sword 192,2 DPS (which is not able to cleave).

So should I still try cleave and attack or should I use build fire-traps e.g., cast,… ?

thanks for any help in advance

Hi @Naddali275 and welcome to the forum! :partying_face:

Could you send us your code as it is described here so we will be able to help you?

Andrei

1 Like

Hi Andrei, many thanks and also for your quick reply :relaxed:
I used the following and honestly without any idea where and when to place the flag during the fight:

while(true) {
    var flag = hero.findFlag();
    var enemy = hero.findNearestEnemy();
    if (flag) {
        hero.pickUpFlag(flag);
    }
    else if (enemy) {
         if (hero.isReady("cleave")){
            hero.cleave(enemy);
    }
    else {
     hero.attack(enemy);   
        }
    }
}

Thank you,
Natalie

1 Like

I’d move the flag to the area that has the highest damage ogres (to the left, i think). Then, as the battle goes on, move the flag to areas that need help (or look like they do - that’s how i did it).

Hope that helps,
-@Anna

I have done as @Anna said, but do not be afraid to experiment because you may find a better solution, all right @Naddali275?

Andrei

Hey guys,
Unfortunately it didn’t work out. As soon as my hero gets closer to the upper part where many ogres appear, he dies a few seconds afterwards.
As already mentioned, I have no gems to get new weapon or heros so I tried this code:

while(true) {
    var enemy = hero.findNearestEnemy();
    if (hero.canCast("drain-life"), enemy) {
        hero.cast("drain-life", enemy);
    }
    else {
        hero.attack(enemy);
    }
    if (hero.health < hero.maxHealth / 3 && hero.canCast("invisibility")) {
        hero.cast("invisibility", hero);
}
}

where actually happens nothing.

What hero and weapon did you guys use so it worked out with only cleave and attack? Any other ideas whats the reason I cant pass?
Thanks a lot

Can you show us your equipment?

Andrei

This is what I used for the cast code

And this for cleave and attack

Can you show me your recent cleave code? (The cleave is the best way at your level and gems to deal with swarms of munchkins.)

Andrei

sure,

while(true) {
    var flag = hero.findFlag();
    var enemy = hero.findNearestEnemy();
    if (flag) {
        hero.pickUpFlag(flag);
    }
    else if (enemy) {
        if (hero.isReady("cleave") && hero.distanceTo(enemy) < 5) {
               hero.cleave(enemy);
    }
    else {
        hero.attack(enemy);
        }
    }
    else {
            hero.shield();
        }
}

Can you resend me the code but use the U button in the level so the text will be well with the spaces?

Andrei

while (true) {
    var flag = hero.findFlag();
    var enemy = hero.findNearestEnemy();
    if (flag) {
        hero.pickUpFlag(flag);
    } else if (enemy) {
        if (hero.isReady("cleave") && hero.distanceTo(enemy) < 5) {
            hero.cleave(enemy);
        } else {
            hero.attack(enemy);
        }
    } else {
        hero.shield();
    }
}
1 Like

Try to also use bash if you can before you attack.

Andrei

And try to delete this.

Andrei

Hi Andrei,
My hero indeed survives longer, but it is still not enough.
Should I try this level with cast function, what do you mean?

No. But can I see the recent cleave code so I can help you finish the level with this code?

Andrei

Alright, and sorry for taking so much of your time!

while (true) {
    var flag = hero.findFlag();
    var enemy = hero.findNearestEnemy();
    if (flag) {
        hero.pickUpFlag(flag);
    } else if (enemy) {
        if (hero.isReady("cleave")) {
            hero.cleave(enemy);
        } else if (hero.isReady("bash")) {
            hero.bash(enemy);
        } else {
            hero.attack(enemy);
        }
    } else {
        hero.shield();
    }
}

And try to check if you are low on health and you can become invisible, then cast invisibility on yourself and wait for the spell to end using the hero.wait() method.

Andrei

ok, here we go. I also added pet.chase, I thought the more, the better. But still not working

while (true) {
    var flag = hero.findFlag();
    var enemy = hero.findNearestEnemy();
    if (flag) {
        hero.pickUpFlag(flag);
    } else if (enemy) {
        if (hero.isReady("cleave")) {
            hero.cleave(enemy);
        } else if (hero.isReady("bash")) {
            hero.bash(enemy);
        } else {
            hero.attack(enemy);
        }
        if (enemy && enemy.maxHealth < hero.maxHealth / 10) {
            pet.chase(enemy);
        }
        if (hero.health < hero.maxHealth / 3) {
            hero.cast("invisibility", hero);
            hero.wait(hero.cast("invisibility", hero));
        } else {
            hero.shield();
        }
    }
}

Here you should wait a number of seconds. And try to only cast invisibility before you move to pick up the flag, so you can delete this

And before you cast the invisibility check if hero.canCast(the name of the spell that you want to cast) is true, and only then cast the spell. Do you understand, @Naddali275 ?

Andrei

1 Like