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)
     
    本攻略发于极客战记官方教学栏目,原文地址为:
  • 相关阅读:
    <庆余年>
    JUC-12.3-线程的调度
    JUC-12.1-线程池介绍
    JUC-12.2-线程池使用
    JUC-11-线程八锁
    JUC-10-ReadWriteLock读写锁
    JUC-9-线程按序交替
    JUC-8-lock和Condition使用
    JUC-7-lock接口
    xcode单词及回调
  • 原文地址:https://www.cnblogs.com/codecombat/p/13183917.html
Copyright © 2011-2022 走看看