Комментарии: CodeCombat. Гора Порвитучу. Охота. (Hunting Party) https://coolcode.ru/codecombat-gora-porvituchu-ohota-hunting-party/ Скриптописание и кодинг Thu, 22 Nov 2018 13:37:18 +0000 hourly 1 https://wordpress.org/?v=5.8.12 Автор: Виталий https://coolcode.ru/codecombat-gora-porvituchu-ohota-hunting-party/#comment-2586 Thu, 22 Nov 2018 13:37:18 +0000 http://coolcode.ru/?p=8589#comment-2586 `friends = hero.findFriends()
for i in range(len(friends)):
friend = friends[i]
if friend.type == «soldier»:
hero.command(friend, «move», {«x»:friend.pos.x+20,»y»:friend.pos.y})
hero.say(«align»)

hero.say(«go»)
num =1
while True:
for i in range(len(friends)):
friend = friends[i]
enemy = friend.findNearestEnemy()
if friend.health<friend.maxHealth / 3:
hero.command(friend, "move", {"x":12,"y":45})
elif enemy:
hero.command(friend, "attack", enemy)
else:
hero.command(friend, "move", {"x":friend.pos.x+5,"y":friend.pos.y})
hero.say(num)
if num == 1:
num=2
else:
num=1

]]>