// 收集硬币,忽略砂耗牛和树榴。和投掷者,食人魔战斗。 loop { enemy = this.findNearestEnemy(); item = this.findNearestItem(); flag = this.findFlag(); if (flag) { this.pickUpFlag(flag); } if (enemy) { if (enemy.type == "sand-yak" || enemy.type == "burl") { // 别和砂耗牛,树榴打!赶紧收集硬币。 if (item) { // 收集钱币。 var itemp = item.pos ; var x = itemp.x ; var y = itemp.y ; this.moveXY(x, y); } } // 但如果敌人的类型是『投掷者』或者『食人魔』,攻击他们 else { if (this.isReady("cleave")) { this.cleave(enemy); } if (this.isReady("bash")) { this.bash(enemy); } else { this.attack(enemy); } } } else if (item) { // 收集钱币。 var itempos = item.pos ; var x1 = itempos.x ; var y1 = itempos.y ; this.moveXY(x1, y1); } }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2、强壮的沙牦牛
// 当牦牛靠近时向右移动10米来躲避 // 躲避4头牦牛完成此关 loop { // 使用 if 仅仅当牦牛少于10米距离的时候。 var enemy = this.findNearestEnemy(); var distance = this.distanceTo(enemy); if (distance < 10) { var x = this.pos.x + 10; var y = this.pos.y; this.moveXY(x, y); } // 向右移动加上你当前的 X 坐标 // 使用的灵石来感知 this.pos. }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3、绿洲
// 向绿洲移动 // but move left to avoid nearby yaks. loop { var enemy = this.findNearestEnemy(); if (enemy && this.distanceTo(enemy) < 10) { // 通过在你的X坐标上减去10来移动到左边 var x =this.pos.x - 10 ; var y =this.pos.y ; this.moveXY(x, y); } else { // 通过在你的X坐标上加上10来移动到右边 var x1 = this.pos.x + 10 ; var y1 = this.pos.y ; this.moveXY(x1, y1); } }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4、萨文路
// 到达绿洲。小心新的敌人:食人魔侦察兵! // 通过添加你当前的X位置和Y位置以向上向右走 loop { // 攻击任何你看到的敌人,或者一直向上向右走 var enemy = this.findNearestEnemy(); if (enemy) { if (this.isReady("cleave")) { this.cleave(enemy); } if (this.isReady("bash")) { this.bash(enemy); } else { this.attack(enemy); } } else { var x = this.pos.x + 10; var y = this.pos.y + 10; this.moveXY(x, y); } }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5、Sarven 的距离
// 每次向下移动10米,来走到绿洲。 // 在每个食人魔左边20米的位置建造栅栏。 loop { enemy = this.findNearestEnemy(); if (enemy) { // 在敌人左边建造20个单位的栅栏。 var buildpos = enemy.pos ; var x = buildpos.x - 20 ; var y = buildpos.y ; this.buildXY("fence", x, y); } else { // 每次向下移动10个单位。 var mypos = this.pos ; var myx = mypos.x ; var myy = mypos.y - 10; this.moveXY(myx, myy); } }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6、雷蹄
// 到达绿洲, // 用栅栏引导砂牦牛到你去的地方 loop { var yak = this.findNearestEnemy(); if (yak) { // 如果它的 y 值大于你的,那么耗牛在你前面 // 如果耗牛在你前面,在它后面10米建立一个栅栏 var x = yak.pos.x ; var y = yak.pos.y ; if (yak.pos.y > this.pos.y) { y -= 10 ; this.buildXY("fence", x, y); } // 如果耗牛在你后面,在它前面10m 建立一个栅栏 else { y += 10 ; this.buildXY("fence", x, y); } } else { // 向右移动10走向绿洲 this.moveXY(this.pos.x + 10, this.pos.y); } }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7、医疗注意
// 向救助者求救,当你的生命低于1/3的时候 loop { var currentHealth = this.health; var healingThreshold = this.maxHealth / 3; var enemy = this.findNearestEnemy(); // 如果你当前的健康值少于下限, // 移动到治疗点说『heal me』 // 否则的话,攻击。你需要战斗的更狠点! if (currentHealth < healingThreshold) { this.moveXY(65, 46); this.say("『heal me』"); } else { if (this.isReady("bash")) { this.bash(enemy); } if (this.isReady("cleave")) { this.cleave(enemy); } else { this.attack(enemy); } } }
// 让农民和他们的拯救者通过雷区。 // 移动金币,触发火焰陷阱。 // The mines are randomized, so use findItems. // 向后移动十米,然后喊『heal』 如果你的生命值低了。 loop { var items = this.findNearestItem(); if (items) { var item = items.pos; var x = item.x ; var y = item.y ; this.moveXY(x, y); }