The One Wizard - HELP!

My code is working fine but when the big ogres come I die. Here’s my code:

# Defeat as many ogres as you can.
# Use 'cast' and 'canCast' for spells.
while True:
    enemy = hero.findNearestEnemy()
    if not enemy and hero.canCast("regen", hero):
        hero.cast("regen", hero)
    if enemy and enemy.type != "catapult":
        if hero.canCast("lightning-bolt", enemy):
            hero.cast("lightning-bolt", enemy)
        elif hero.canCast("chain-lightning", enemy):
            hero.cast("chain-lightning", enemy)
        elif hero.canCast("root", enemy) and hero.distanceTo(enemy)>5:
            hero.cast("root", enemy)
            hero.attack(enemy)
        elif not enemy and hero.canCast("regen", hero):
            hero.cast("regen", hero)
    else:
        if enemy:
            hero.say("C'mon! Move you stupid catapult!")
            hero.say("C'mon!")
            hero.moveXY(hero.pos.x+20, hero.pos.y)
            hero.cast("lightning-bolt", enemy)
            hero.moveXY(hero.pos.x-20, hero.pos.y)

I manage to get about 32 kills but then the big orges come and kill me.

Try going to the grey circle when you see the big ogres.

2 Likes

When you find the catapults, move around and back, the catapults will kill the ogres with their missiles, which will then cause a chain reaction of fire traps to kill the catapults.

2 Likes

wait…finally! I got 44 of them! I went to the grey circle and yes, the circle made everything explode!

2 Likes

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.