zoukankan      html  css  js  c++  java
  • 「网易官方」极客战记(codecombat)攻略-沙漠-诅咒谷-cursed-valley

    (点击图片进入关卡)

    这太热了,太热了。 专注在你的任务上,不要被炎热分心。

    简介

    炎热的太阳正在耗尽英雄的生命值! 保存你的力量!

    只有在 enemy.team 是 "ogres" 和 enemy.type 是 "skeleton" 时才会被攻击。

    除非 item.type 是 "potion" 并且 hero.health 小于 hero.maxHealth / 4 ,否则不要收集任何项目。

    默认代码

    # 炎热的太阳正在耗尽英雄的生命值!

     

    while True:
        enemy = hero.findNearestEnemy()
        # 攻击!如果敌人存在且enemy.team 为 "ogres"
        # 并且 enemy.type是 "skeleton"
        if enemy and enemy.team == "ogres" and enemy.type == "skeleton":
            hero.attack(enemy)

     

        item = hero.findNearestItem()
        # 收集物品,如果物品存在且 item.type是"potion"
        # 并且 hero.health小于hero.maxHealth / 4

    概览

    被诅咒的墓地是一个危险的地方!

    确保检查骨架的类型,以便英雄不会攻击任何牦牛。 还要确保只攻击 "ogres" 团队中的骷髅。

    对物品做同样的事情。 如果英雄的生命值低于 hero.maxHealth / 4 ,那么只能拿到药水。

    诅咒谷 解法

    # 炎热的太阳正在耗尽英雄的生命值!

     

    while True:
        enemy = hero.findNearestEnemy()
        # 攻击!如果敌人存在且enemy.team 为 "ogres"
        # 并且 enemy.type是 "skeleton"
        if enemy and enemy.team == "ogres" and enemy.type == "skeleton":
            hero.attack(enemy)

     

        item = hero.findNearestItem()
        # 收集物品,如果物品存在且 item.type是"potion"
        # 并且 hero.health小于hero.maxHealth / 4
        if item and item.type == "potion" and hero.health < hero.maxHealth / 4:
            hero.move(enemy)
     
    本攻略发于极客战记官方教学栏目,原文地址为:
  • 相关阅读:
    int&amp;boolean——Java和C的一点小差别
    华宇软件笔试题
    腾讯笔试感受
    JavaScript-创建第一个自己的类库
    大数据处理之道 (htmlparser获取数据&lt;一&gt;)
    mui.fire()用法
    Juicer 轻量级javascript模板引擎
    art-template引擎模板
    js模板引擎-art-template常用总结
    移动端开发框架Zepto.js
  • 原文地址:https://www.cnblogs.com/codecombat/p/13183917.html
Copyright © 2011-2022 走看看