[SOLVED] Help! Summits Gate

Hello! I’m finally on Summit’s Gate!
So first, I want to know how to command paladins and what is a good strategy I could improvise and use?
Help greatly appreciated!
Lydia

3 Likes

Can you give us your code @Lydia_Song?

1 Like

I don’t have any code yet, I want to get a strategy first and then “develop” my code that way.
Lydia

2 Likes

Why don’t you command the whole army of soldiers at the start?

1 Like

I think the best strategy is to use flags. Because you can go near catapults and when they shoot you can go from them and they will kill themselfs by their missiles. Then you can shield near beamtowers while your archers are attacking them. Then… the most difficult part - warlocks. They summon skeletns and they are powerful. You can use invisibility to collect all gems and summon more units.

To command paladins:

While True:
   friends = hero.findFriends()
   for friend in friends:
     if friend and friend.type == "paladin" and friend.team == hero.team:
       if friend.canCast("heal"):
          hero.command(friend, "cast","heal",hero)
       else:
           hero.command(friend, "attack", friend.findNearestEnemy())

You need to know your paladin team because if warlock will “raise-dead” your paladin and you will try to command it you will get an error.

5 Likes

I am pretty sure that the hero.team part is supposed to be "humans".

3 Likes

@abc hero.team and "humans" are the same for this case, because calling hero.team returns the hero’s team, which is "humans". And since we’re checking if the paladin is on the same team as our hero, calling friend.team == hero.team is also a viable method.

4 Likes

Oh okay, I didn’t know that.

3 Likes

What can paladins do?
Lydia

1 Like

Paladins can shield can attack and can heal other units(if their not dead)

1 Like

Who’s your hero?

My top-chart reccomendations:
One
Two
Three
Four

Promoting myself)

2 Likes

Naria or the starter heroes.
Lydia

1 Like

If you use Naria use her abilities

1 Like

Well, Naria could be fast and dangerous, I think)
As for strategies and advices - I think I can’t imagine something more that I provided via links.
Good luck!)

3 Likes
# Fight your way into the Inner Sanctum of the ogre chieftain, and defeat her.
def commandPal():
    friends = hero.findFriends()
    for friend in friends:
        if friend and friend.type == "paladin" and friend.team == hero.team:
            enemyF=friend.findNearestEnemy()
            if friend.canCast("heal"):
                hero.command(friend, "cast","heal",hero)
            elif enemyF:
                hero.command(friend, "attack", enemyF)

def commandOther():
    friends = hero.findFriends()
    for friend in friends:
        if friend and friend.type == "archer" or friend.type == "soldier":
            if friend.team == hero.team:
                enemyF = friend.findNearestEnemy()
                if enemyF:
                    hero.command(friend, "attack", enemyF)
                else:
                    hero.command(friend, "move", {'x':hero.pos.x + 10, 'y':hero.pos.y})

def flag():
    flag = hero.findFlag("black")
    if flag:
        hero.move(flag.pos)
        hero.pickUpFlag(flag)
    else:
        pass

def hide():
    if hero.isReady("hide"):
        hero.hide()
    else:
        pass

def envenom():
    if hero.isReady("envenom"):
        hero.envenom()
    else:
        pass

def throw():
    enemy = hero.findNearestEnemy()
    
    if hero.isReady("throw"):
        hero.throw(enemy)
    else:
        pass

def attack():
    enemy = hero.findNearestEnemy()
    if enemy:
        envenom()
        throw()
        hero.scattershot(enemy)

def summon():
    if hero.gold > hero.costOf("griffin-rider"):
        hero.summon("griffin-rider")

while True:
    commandPal()
    commandOther()
    flag()
    attack()
    summon()


My hero gets stuck on this:


And won’t go to the flag.
Lydia

Ah, I know what your problem is

Your hero is currently trying to attack the door to the last battle. Something like this could solve the problem

def attack(enemy):
    if hero.distanceTo(enemy) < hero.attackRange:
        hero.attack(enemy)
    else:
        hero.move(enemy.pos)
1 Like

Now I die here:

Lydia

you can delete this line

check if the enemy is in throw range

1 Like

Well, maybe try to command your troops to go attack first then you go behind them, so the beam towers will focus your friends instead(or you can just skip the beam towers and attack the door)

1 Like


I passed it! I’m honestly surprised I didn’t take 3 months (as Restless Dead did) :slight_smile:
Lydia

4 Likes