极客战记/codecombat-狩猎派对/hunting-party

时间:2024-10-13 14:29:59

1、角色

2、装备

极客战记/codecombat-狩猎派对/hunting-party

3、目标

极客战记/codecombat-狩猎派对/hunting-party
极客战记/codecombat-狩猎派对/hunting-party

4、默认代码

极客战记/codecombat-狩猎派对/hunting-party

5、代码#命令你的部队向东移动,攻击任何看到的食人魔。#使用for循环和findFriends方法。#你能在你的士兵上使用find绿覆冗猩NearestEnemy()来获取他们的而不是你的最近的敌人。whileTrue:friends=hero.findFriends()forjinrange(len(friends)):friend=friends[j]iffriend.type=="soldier":x=friend.pos.x+10eliffriend.type=="archer":x=friend.pos.x+5y=friend.pos.yenemy=friend.findNearestEnemy()ifenemy:iffriend.health<friend.maxHealth*0.5:x=13hero.command(friend,"move",{"x":x,"y":y})continuehero.command(friend,"attack",enemy)else:hero.command(friend,"move",{"x":x,"y":y})

极客战记/codecombat-狩猎派对/hunting-party

6、运行

极客战记/codecombat-狩猎派对/hunting-party
© 手抄报圈