My hero (Ritic the Cold) gets past the first wave of ogres and all my other units die, but then he goes in between both beam towers and dies. Sometimes he gets past but then he gets killed by either a skeleton or a warlock. Here is my code:
# Fight your way into the Inner Sanctum of the ogre chieftain, and defeat her.
while True:
enemy = hero.findNearestEnemy()
flag = hero.findFlag("green")
friends = hero.findFriends()
if flag:
hero.pickUpFlag(flag)
elif enemy and enemy.type == "tower":
hero.attack(enemy)
elif enemy:
for friend in friends:
hero.command(friend, "attack", enemy)
hero.attack(enemy)
# Fight your way into the Inner Sanctum of the ogre chieftain, and defeat her.
while True:
enemy = hero.findNearestEnemy()
flag = hero.findFlag("green")
friends = hero.findFriends()
paladins = hero.findByType("paladin")
if flag:
hero.pickUpFlag(flag)
elif enemy and enemy.type == "tower":
hero.attack(enemy)
elif enemy:
for friend in friends:
hero.command(friend, "attack", enemy)
hero.attack(enemy)
if hero.health < 1355:
for paladin in paladins:
hero.command(paladin, "cast", "heal", hero)
In each of my army of units there are two paladins, so each of them should be able to cast heal twice but instead I get that error when my paladins try to cast heal.
while True:
enemy = hero.findNearestEnemy()
flag = hero.findFlag("green")
friends = hero.findFriends()
paladins = hero.findByType("paladin")
if flag:
hero.pickUpFlag(flag)
elif enemy and enemy.type == "tower":
hero.attack(enemy)
elif enemy:
for friend in friends:
hero.command(friend, "attack", enemy)
hero.attack(enemy)
if hero.health < 1355:
for paladin in paladins:
if paladin.canCast("heal"):
hero.command(paladin, "cast", "heal", hero)
while True:
enemy = hero.findNearestEnemy()
flag = hero.findFlag("green")
soldiers = hero.findByType("soldier")
archers = hero.findByType("archer")
paladins = hero.findByType("paladin")
if flag:
hero.pickUpFlag(flag)
elif enemy and enemy.type == "tower":
hero.attack(enemy)
elif enemy:
for soldier in soldiers:
hero.command(soldier, "attack", enemy)
for archer in archers:
hero.command(archer, "attack", enemy)
for paladin in paladins:
if hero.health < 1355:
for paladin in paladins:
if paladin.canCast("heal"):
hero.command(paladin, "cast", "heal", hero)
else:
hero.command(paladin, "defend", hero)
hero.attack(enemy)
# Fight your way into the Inner Sanctum of the ogre chieftain, and defeat her.
while True:
enemy = hero.findNearestEnemy()
flag = hero.findFlag("green")
friends = hero.findFriends()
paladins = hero.findByType("paladin")
if enemy and enemy.type == "warlock":
hero.attack(enemy)
for friend in friends:
if friend and friend.type != "paladin":
hero.command(friend, "attack", enemy)
else:
if flag:
hero.pickUpFlag(flag)
elif enemy and enemy.type == "tower":
hero.attack(enemy)
elif enemy:
for friend in friends:
if friend and friend.type != "paladin":
hero.command(friend, "attack", enemy)
for paladin in paladins:
if hero.health < 1355:
for paladin in paladins:
if paladin.canCast("heal"):
hero.command(paladin, "cast", "heal", hero)
elif enemy:
for paldin in paladins:
hero.command(paladin, "attack", enemy)
hero.attack(enemy)