Help: Levels in Glacier

Replace your vector subtract line with

 vector = Vector.subtract(enemy.pos, hero.pos)

and you have to do vector.y vector.x not vector.y vector.y

1 Like

should be this

radians = Math.atan2(vector.y,vector.x)

and not this

radians = Math.atan2(vector.y,vector.y)
1 Like

Now I’m stuck on kelvintaph crusader

# You can find friends through walls, but not enemies.
# Watch out for smooth, frictionless ice patches!
while True:
    enemy = hero.findNearestEnemy()
    friends = hero.findFriends()
    flag = hero.findFlag("green")
    for friend in friends:
        witch = friend.findNearest(hero.findByType("witch"))
        enemy = friend.findNearestEnemy()
        if enemy:
            if friend.type == "paladin" and witch:
                hero.command(friend, "attack", witch)
            elif friend.type == "paladin" and enemy:
                hero.command(friend, "shield", friend)
        else:
            if friend.pos.x < 42:
                hero.command(friend, "move", {'x': 42, 'y': 58})
            elif friend.pos.x < 56:
                hero.command(friend, "move", {'x': 38, 'y': 56})
            else:
                hero.command(friend, "move", {'x': 78, 'y': 40})
    if enemy:
        ogre = hero.findNearest(hero.findByType("ogre"))
        if ogre and hero.canCast("chain-lightning"):
            hero.cast("chain-lightning", ogre)
        elif flag:
            hero.pickUpFlag(flag)

is my code. The ogres die alright but when it’s time for chain-lightning 2 my hero stays in place. HELP!

1 Like

You don’t attack and what if your friend type is not paladin what are they going to do

1 Like

ah, well, the ogres die ok. And the friends auto-attack too. I just need the paladin to target the witch, and be a shielding decoy.

1 Like

It’s the chain-lightning. After 20.75 secs my hero just stays there. Doesn’t move.

1 Like

You dont need the paladin to do this

you can just command your paladin to move to the x spot and use your other troops as bait

1 Like

1 Like

Not fast enough. Killing the enemies is more important. My archer is stuck.

1 Like

use flags for your friends too.

1 Like

maybe command your archer too

1 Like

see look it works for me
I just commanded the paladin to heal self and to move to the x


all the other troops where baits/decoys so that the ogres and skeletons wouldnt target the paladin

1 Like

I didnt get the bonus though
The bonus gives more gems and exp than the mission

1 Like

My friends aren’t attacking. It’s kelvintaph burglar. @Eric_Tang help?

# What eldritch artifacts are these? Don't let them blast you!
# The ice gate will open when both ogres are defeated.
points = 0
while True:
    flag = hero.findFlag("green")
    friends = hero.findFriends()
    enemy = hero.findNearestEnemy()
    for friend in friends:
        if hero.isPathClear(friend, enemy) and enemy.type != "ice-yak":
            hero.command(friend, "attack", enemy)
        elif points == 0:
            hero.command(friend, "move", {'x': 26, 'y': 50})
            points += 1
        elif points == 1:
            hero.command(friend, "move", {'x': 53, 'y': 50})
            points += 1
        else:
            hero.command(friend, "move", {'x': 78, 'y': 40})
    if flag:
        hero.pickUpFlag(flag)
1 Like


Now my friends won’t target witch. @Falcons118 or @Eric_Tang or @Deadpool198 help?

1 Like

Post your code please

1 Like

Just delete the is pathClear part.
Add also try to use flags for your friends its not easy but possible.

1 Like
# What eldritch artifacts are these? Don't let them blast you!
# The ice gate will open when both ogres are defeated.
points = 0
while True:
    flag = hero.findFlag("green")
    friends = hero.findFriends()
    enemy = hero.findNearestEnemy()
    for friend in friends:
        enemy = friend.findNearestEnemy()
        witch = hero.findNearest(hero.findByType("witch"))
        if enemy and enemy.type != "ice-yak":
            if witch and friend.type == "paladin":
                hero.command(friend, "attack", witch)
            hero.command(friend, "attack", enemy)
        elif points == 0:
            hero.command(friend, "move", {'x': 26, 'y': 50})
            points += 1
        elif points == 1:
            while points == 1:
                hero.command(friend, "move", {'x': 54, 'y': 38})
                points += 1
        else:
            hero.command(friend, "move", {'x': 78, 'y': 40})
    if flag:
        hero.pickUpFlag(flag)

Try to do flags instead of points.

There’s trig in glacier!! :scream: :scream: :frowning: