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
Can you give us your code @Lydia_Song?
I don’t have any code yet, I want to get a strategy first and then “develop” my code that way.
Lydia
Why don’t you command the whole army of soldiers at the start?
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.
I am pretty sure that the hero.team
part is supposed to be "humans"
.
@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.
Oh okay, I didn’t know that.
What can paladins do?
Lydia
Paladins can shield can attack and can heal other units(if their not dead)
Naria or the starter heroes.
Lydia
If you use Naria use her abilities
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!)
# 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)
you can delete this line
check if the enemy is in throw range
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)