当前位置: 首页>>代码示例>>Python>>正文


Python Actions.boss_combat_mode方法代码示例

本文整理汇总了Python中Actions.boss_combat_mode方法的典型用法代码示例。如果您正苦于以下问题:Python Actions.boss_combat_mode方法的具体用法?Python Actions.boss_combat_mode怎么用?Python Actions.boss_combat_mode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Actions的用法示例。


在下文中一共展示了Actions.boss_combat_mode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: gameloop

# 需要导入模块: import Actions [as 别名]
# 或者: from Actions import boss_combat_mode [as 别名]
def gameloop(player, travel):
    choice = ""
    while choice != "quit":
        choice = input(">>> ")
        # using commands
        if choice == "help":
            Actions.get_help(player)
        elif choice == "look":
            Travel.look(travel)
        elif choice == "move":
            Travel.move(travel)
            in_city = False
            for city in Cities:
                if travel.x == city[1] and travel.y == city[2]:
                    print("You are now in " + city[0])
                    in_city = True
                else:
                    pass
            if in_city == False:
                name, hp, attack, toughness = random.choice(Enemies)
                mob = Enemy(name, hp, attack, toughness)
                
                Actions.combat_mode(player, mob)
                
        elif choice == "location":
            Travel.get_location(travel)
        elif choice == "map":
            Travel.map(travel, player)
        elif choice == "stats":
            Actions.stats(player)
        elif choice == "read note":
            Actions.read_note(player)
        elif choice == "inventory":
            Actions.check_inventory(player)
        elif choice == "potions":
            Actions.check_potions(player)
        elif choice.partition(" ")[0] == "check":
            try:
                Actions.check_item(player, choice.partition(" ")[2])
            except IndexError:
                print("You need an item to check")
        elif choice == "boss":
            in_city = False
            for city in Cities:
                if travel.x == city[1] and travel.y == city[2]:
                    in_city = True
                    if city_completion[city[0]] == True:
                        print("You have already killed this cities boss")
                    else:
                        for boss in Bosses:
                            if city[0] in boss:
                                name, hp, attack, toughness = boss[1], boss[2], boss[3], boss[4]
                                boss_mob = Enemy(name, hp, attack, toughness)
                                Actions.boss_combat_mode(player, boss_mob)
                                Actions.get_item(player, boss[5])
                                city_completion[city[0]] = True
                else:
                    pass
            if in_city == False:
                print("Bosses are in each city")
        elif choice == "wallet":
            Actions.coins(player)
        elif choice == "shop":
            in_city = False
            for city in Cities:
                if travel.x == city[1] and travel.y == city[2]:
                    in_city = True
                    Actions.shop(player)
                else:
                    pass
            if in_city == False:
                print("There is a shop in each city")
        elif choice == "attack":
            print("You slash the air")
        elif choice == "victory":
            Actions.victory(player)
        elif choice == "save":
            SaveLoad.save(player, travel)
        elif choice =="load":
            SaveLoad.load(player, travel)        
        elif choice == "quit":
            sys.exit()
        else:
            print("invalid choice - type 'help' for commands")
开发者ID:LibLib97,项目名称:Python-Test-RPG,代码行数:86,代码来源:Text-Based+RPG.py


注:本文中的Actions.boss_combat_mode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。