[Adventurer] The One Wizard

how do you avoid the firetraps?

1 Like

I said use lightning bolt. It has unlimited range, and it should kill it in one shot.

2 Likes

Nope.

Experiment and try different methods. Think as a player which just completed early forest levels.
<health property is introduced later>

2 Likes

OK this is my new code. Can you help me to make it better?

enemy = hero.findNearestEnemy()
hero.cast("chain-lightning", enemy)
while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        hero.attack(enemy)
        if hero.isReady("root"):
            hero.cast("root", enemy)
        if hero.isReady("chain-lightning"):
            hero.cast("chain-lightning", enemy)
        elif hero.isReady("lightning-bolt") and enemy.type == "scout" or enemy.type == "catapult":
            hero.cast("lightning-bolt", enemy)
        elif hero.isReady("regen") and hero.health<70:
            hero.cast("regen", hero)
        elif hero.isReady("shockwave") and hero.distanceTo(enemy) < 20:
            hero.cast("shockwave", enemy)
        elif hero.distanceTo(enemy) < 5:
            hero.moveXY(8, 36)

1 Like

Hmm, why do root and shockwave work??? Thanks. I will find and remove them.

3 Likes

Why do you need to remove it? Isnā€™t it better if we have more abilities?

1 Like

Also it said in the Hints that we can use root and shockwave.

1 Like

Nope. Itā€™s in the spell pallet and itā€™s automatically

No. If you add all spells and all thangs on the field it doesnā€™t help to make a good level.

5 Likes

Oh ok i understand. :smile:

we canā€™t attack the catapults until we see it, and we canā€™t see it until it is within 60 meters, and it isnā€™t within 60 meters.

3 Likes

The heroā€™s visual range is 65 in this level. Anyway what the problem?
Guys. This is a level for early Forest. Donā€™t complicate it. Try to make your solution step by step. Attack first. Then add some spell, another. The keyword for this level is IF-ELSE-IF.

5 Likes

This is a great little puzzle that took me a few tries. I think the important part (for anyone having trouble as I did) is to understand the way the if-else statements interact and more importantly, understand how to properly nest them.

For example, I originally had my hero check for the ogre AFTER checking the distances to the enemies, like this:

if distance <= 30:
    if hero.canCast("chain-lightning"):
        hero.cast("chain-lightning", enemy)
    else:
        hero.attack(enemy)
elif distance > 30:
    if hero.canCast("lightning-bolt"):
        hero.cast("lightning-bolt", enemy)
elif enemy.type == "ogre":
    hero.moveXY(7, 32)

But because the hero notices the enemy distance first, the enemy.type == ā€œogreā€ statement never runs. I needed the hero to check the enemy type first.

3 Likes

Try to set type checking before distance checking

2 Likes

Wow this level really gets you thinking out of the box.

Before I had a complicated code, then I decided to restart.

The simpler code I wrote after I restarted allowed to get all the bonuses when the complicated one canā€™t.

Great level!

Hint to the people who are stuck on the level:

Hint

Try moving back a bit, so the ogres take longer to reach you.

2 Likes

you still have to be withing 65 meters.

2 Likes

yep. that too. (20 chars)

1 Like

So then i canā€™t attack the catapult.

2 Likes

I pass this level, using the plan array

plan = ["lightning-bolt", 'attack', 'attack', 'attack', 'attack', 'attack', "lightning-bolt", "chain-lightning",
        "regen", 'attack', "regen", "lightning-bolt", "chain-lightning", 'attack', 'attack', "lightning-bolt", 'attack',
        "regen", "lightning-bolt", 'say', "away", 'armagedon']
1 Like

whatā€™s armagedon? (20)

2 Likes

No need to do thatā€¦ You just need to move back so you have more time to attack the ogresā€¦

1 Like