极客战记前三章一些较难关卡攻略

2025-05-12 10:35:16

1、地牢KITHGARD之门# 建造三个围栏来阻挡食人魔!hero.moveDown()hero.buildXY("fence", 36, 34)hero.buildXY("fence", 36, 28)hero.moveRight()hero.moveRight()hero.moveRight()

极客战记前三章一些较难关卡攻略

3、森林 嘲弄# Attack munchkins, call brawlers and ignore burls.# This function defines the hero's behaviour about enemies.def dealEnemy(enemy): # If enemy.type is "munchkin": if enemy.type is "munchkin": hero.attack(enemy) # Then attack it: pass # If the enemy's type is "brawler": if enemy.type is "brawler" : # Then say something to call the brawler: hero.say("help") passwhile True: enemy = hero.findNearestEnemy() if enemy: dealEnemy(enemy) else: hero.moveXY(30, 34)

极客战记前三章一些较难关卡攻略

5、沙漠 诱饵转# 我们在测试一个新的战斗单位:诱饵(decoy)。# 创建4个诱饵,然后汇报给 NariadecoysBuilt = 0while True: coin = hero.findNearestItem() if coin: # 掠夺金币! hero.moveXY(coin.pos.x, coin.pos.y) pass # 每个诱饵消费25个金币。 # 让它知道当你有超过25个金币的时候 if hero.gold >= 25: # buildXY a "decoy" hero.buildXY("decoy", hero.pos.x, hero.pos.y) # 当你一直走的时候,保持统计你创建的诱饵的数量。 decoysBuilt += 1 if decoysBuilt == 4: # 当你创建了4个诱饵时跳出循环 break pass hero.say("完成创建诱饵!")hero.moveXY(14, 36)# 去找 Naria 并告诉她你创建了多少个诱饵。hero.say("I duilded "+decoysBuilt+" decoys !")

极客战记前三章一些较难关卡攻略

7、沙漠 疯狂的MAXwhile True: farthest = None maxDistance = 0 enemyIndex = 0 enemies = hero.findEnemies() # 查看全部敌人,找出最远的那个。 while enemyIndex < len(enemies): target = enemies[enemyIndex] enemyIndex += 1 # 是不是存在远得看不到的敌人? distance = hero.distanceTo(target) if distance > maxDistance: maxDistance = distance farthest = target if farthest: # 干掉最远的敌人! # 如果敌人血量大于0就保持攻击。 while farthest.health > 0: if hero.isReady("cleave"): hero.cleave(farthest) elif hero.isReady("bash"): hero.bash(farthest) else: hero.attack(farthest) pass

极客战记前三章一些较难关卡攻略
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢