I am on Grim Determination and my paladins are not shielding. Here is my code:
# Your goal is to protect Reynaldo
# Find the paladin with the lowest health.
def lowestHealthPaladin():
lowestHealth = 99999
lowestFriend = None
friends = self.findFriends()
for friend in friends:
if friend.type != "paladin":
continue
if friend.health < lowestHealth and friend.health < friend.maxHealth:
lowestHealth = friend.health
lowestFriend = friend
return lowestFriend
def commandPaladin(paladin):
# Heal the paladin with the lowest health using lowestHealthPaladin()
# You can use paladin.canCast("heal") and command(paladin, "cast", "heal", target)
# Paladins can also shield: command(paladin, "shield")
# And don't forget, they can attack, too!
lowestFriend=lowestHealthPaladin()
if lowestFriend and paladin.canCast("heal",lowestFriend):
self.command(paladin, "cast","heal", lowestFriend)
enemy=paladin.findNearest(paladin.findEnemies())
if enemy:
self.command(paladin, "attack", enemy)
self.command(paladin, "shield", enemy)
pass
def commandFriends():
# Command your friends.
friends = self.findFriends()
for friend in friends:
if friend.type == "peasant":
item = friend.findNearest(friend.findItems())
self.command(friend, "move", item.pos)
pass
elif friend.type == "griffin-rider":
enemy=friend.findNearest(friend.findEnemies())
if enemy:
self.command(friend, "attack", enemy)
pass
elif friend.type == "paladin":
commandPaladin(friend)
loop:
commandFriends()
if self.gold>self.costOf("griffin-rider"):
self.summon("griffin-rider")