I’ve been working on square shield, but I’m not sure what to do when the paladins arrive in their positions. Should they heal me, attack something, shield, heal me, heal themselves, defend their position, or is my code wrong and they automatically do whatever they’re supposed to do once they reach their position?
# Incoming yeti attack! Use your paladins to form a square!
def findByName(name, thangs):
for i in range(len(thangs)):
thang = thangs[i]
if thang.id == name:
return thang
return None
friends = hero.findFriends()
# Celadia is in the top left corner.
celadia = findByName("Celadia", friends)
# Dedalia is in the top right corner.
dedalia = findByName("Dedalia", friends)
sideLength = celadia.distanceTo(dedalia)
# Illumina and Vaelia should finish forming a square!
vaelia = findByName("Vaelia", friends)
illumina = findByName("Illumina", friends)
vaeliaPos = {'x':celadia.pos.x, 'y':celadia.pos.y - sideLength}
illuminaPos = {'x':dedalia.pos.x, 'y':vaelia.pos.y}
# Command Vaelia to move to the bottom left corner of the square.
hero.command(vaelia, "move", vaeliaPos)
# Command Illumina to move to the bottom left corner of the square.
hero.command(illumina, "move", illuminaPos)
After this part of the code, I experimented with them shielding, healing, defending, etc.