I have certain gear equipped (such as the sword of the forgotten, emporer’s gloves, programmication IV, boss star III, etc.), or the gear that I equipped before entering the dueling grounds. However, this gear is only equipped when I am on the red team. When I am on the blue team, my gear changes back to the gear I had equipped the first time I ever played in the dueling grounds.
Code when on red team:
def summonSoldier():
# Fill in code here to summon a soldier if you have enough gold.
if hero.gold>=hero.costOf("archer"):
hero.summon("archer")
elif hero.gold>=hero.costOf("soldier"):
hero.summon("soldier")
# This function commands your soldiers to attack their nearest enemy.
def commandSoldiers():
for soldier in hero.findFriends():
enemy = soldier.findNearestEnemy()
if enemy:
hero.command(soldier, "attack", enemy)
while True:
enemy = hero.findNearestEnemy()
item = hero.findNearestItem()
summonSoldier()
commandSoldiers()
if item:
hero.move(item.pos)
elif enemy:
if hero.canCast("chain-lightning", enemy):
hero.cast("chain-lightning", enemy)
elif hero.isReady("bash"):
hero.bash(enemy)
else:
hero.attack(enemy)
Code when on blue team:
# Defeat the enemy hero in a duel!
while True:
# Find and attack the enemy inside a loop.
# When you're done, submit to the multiplayer ladder!
enemy = hero.findNearestEnemy()
if hero.isReady("cleave"):
hero.cleave(enemy)
else:
hero.attack(enemy)
My gear also changes when I am on blue team, as my gear changes to having things like programmication II, long sword, defensive infantry sheild, etc. please fix this so I can do much better on the ladder!