极客战记攻略——挑战:一个巫师 | Python

在少爷的不断鞭策下,我们终于拿到了最高奖励!【捂脸】
打卡记录下

通关记录
while True:
    enemy=hero.findNearestEnemy()
    if enemy:
        distance = hero.distanceTo(enemy)
        if enemy.type == "ogre":        #如果是巨人,赶紧引爆fire-trap
            hero.moveXY(6, 38)
        elif distance > 30:
            #远距离时,使用lightning-blot魔法,因为它的攻击范围很大
            if hero.canCast("lightning-bolt", enemy):
                hero.cast("lightning-bolt", enemy)
        else:
            #近距离时,使用chain-lightning魔法
            if hero.canCast("chain-lightning", enemy):
                hero.cast("chain-lightning", enemy)
            else:
                hero.attack(enemy)
    else:
        #如果没有敌人,就给自己加血
        if hero.canCast("regen", hero):
            hero.cast("regen", hero)

A 附注

当前地图:边地森林
关卡链接:https://codecombat.163.com/play/level/the-one-wizard?

B 同主题文章

极客战记攻略——Kithgard地牢 | python
极客战记攻略——深藏的宝石 | python
极客战记攻略——幽影守卫 | python
极客战记攻略——真名实姓 | python
极客战记攻略——高举之剑 | python
极客战记攻略——焰中舞动 | python
极客战记攻略——kithmaze二度冒险 | python
极客战记攻略——老对手 | python
极客战记攻略——名称大师 | python
极客战记攻略——矮人骚乱 | python
极客战记攻略——Kithmaze最终历险 | python
极客战记攻略——Kithgard之门 | python

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。