Пример #1
0
def hero_statistics():
    cheat_mode_on_off()
    line()
    print("Количество жизни Героя:{: <19}{}".format("", life()))
    print("Максимальный урон:{: <22}{}".format("", max_hero_hit()))
    line()
    short_log()
    module_wallet()
    module_more_statistics()
    module_loot()
Пример #2
0
            def frame():
                # проверка на чит режим
                cheat_mode_on_off()

                line()
                print("{: <20}{} {: ^10}{}{: ^10} {}{: >20}".format(
                    "", h.title(), "", sw, "",
                    mob_name().title(), ""))
                line()
                print("Health (now/max):        {}/{}{: ^20}{}/{}".format(
                    int_hero_life, float(life()), "", int_mob_life,
                    float(mob_hp())))
                print("Hit (now/max):           {}/{}{: ^20}{}/{}\n".format(
                    hero_hits, max_hero_hit(), "", mob_hits, max_mob_hit()))
                if module_expended_statics == 1:
                    module_expended_statics_check()
                # короткий лог + тестовый полигон
                test()
                short_log()
Пример #3
0
        def combat():
            mob_rand_name()
            random_mob_hp()
            global all_mob_hits, all_hero_hits
            from system.definition import short_log, line, test
            from system.modules import module_expended_statics
            import threading
            module_expended_statics()
            module_expended_statics = module_expended_statics()

            h = hero_name()
            # max_hit = max_hero_hit()
            mob_life_attack = float(mob_hp())
            hero_life = float(life())
            mob_hit()
            max_mob_hit()
            # m_max_ht = round(max_mob_hit(), 2)
            sw = 0

            def module_expended_statics_check():
                print("Hero/Mob damages:{}/{}".format(round(all_hero_hits, 2), round(all_mob_hits, 2)))

            # Рамка во время боя
            def frame_game():
                # проверка на чит режим
                cheat_mode_on_off()

                line()
                print("{: <20}{} {: ^10}{}{: ^10} {}{: >20}".format("", h.title(), "", sw, "", mob_name().title(), ""))
                line()
                print(
                    "Health (now/max):        {}/{}{: ^20}{}/{}".format(int_hero_life, float(life()), "", int_mob_life,
                                                                        float(mob_hp())))
                print("Hit (now/max):           {}/{}{: ^20}{}/{}\n".format(hero_hits, max_hero_hit(), "", mob_hits,
                                                                            max_mob_hit()))
                if module_expended_statics == 1:
                    module_expended_statics_check()

                # короткий лог + тестовый полигон
                test()
                short_log()

            def frame():
                frame = threading.Thread(target=frame_game)
                frame.start()

            # лут и деньги
            def loots():
                # импорт модулей
                from system.modules import module_cash_switch, module_loot_switch
                module_loot = module_loot_switch()
                module_cash_switch = module_cash_switch()

                # новый опыт и запуск функции добавление опыта
                print("New experience {: <12}+{}".format("", float(exper())))
                hero_next_lvl()

                # новые деньги и запуск функции добавление денег в кошелек
                if module_cash_switch == 1:
                    print("New money {: <18} +{}".format("", new_gold_to_wallet()))

                # новые вещи и функция добавленеи вещей в мешок
                if module_loot == 1:
                    print("New loot:{: <20} construct".format(""))
                    line()

            # логи и характеристика персонажа после боя
            def logs():
                global all_mob_hits, all_hero_hits

                # характеристика полезная
                hero_statistics()

                # разная статистика по персонажу, временная на текущий бой
                print("Rounds:{}".format(sw), end=" ")
                if module_expended_statics == 0:
                    print(" | Hero/Mob damages:{}/{}".format(round(all_hero_hits, 2), round(all_mob_hits, 2)))

                all_mob_hits = 0
                all_hero_hits = 0
                line()

                # Сюда записывать все временные логи, которые появились после боя
                def write_logs():
                    pass

            # начало боя
            while True:

                # отображает номер строки раунда
                time.sleep(1)
                sw += 1
                hero_hits = 0
                mob_hits = 0

                # кидаем костяшки на инициативу хода между мобом и гг
                line()
                hero_random = random.random()
                mob_random = random.random()
                int_mob_life = round(mob_life_attack, 2)
                int_hero_life = round(hero_life, 2)

                # проверка на инициативу героя
                if hero_random >= mob_random:
                    hero_hits = round(hero_hit(), 2)
                    luck_now()

                    # проверка на удачу в бою
                    if luck_now == True:

                        # если удача улыбнулась удар max + random_hit
                        max_hit = max_hero_hit()
                        hero_hits = max_hit + hero_hits
                        hero_hits = round(hero_hits, 2)
                        mob_life_attack -= hero_hits
                        int_mob_life = round(mob_life_attack, 2)
                        int_mob_life = round(mob_life_attack, 2)
                        int_hero_life = round(hero_life, 2)
                        all_hero_hits += max_hit

                        os.system('clear')

                        line()
                        print("{:^7}\nТебе улыбнулись сами боги! {} лупит со всей силы! КРИТ! {}НР.\n".format("",
                                                                                                              hero_name().title(),
                                                                                                              hero_hits))

                        # рамка #####
                        frame()
                        #############

                    # обычный удар героя
                    else:
                        mob_life_attack -= hero_hits
                        int_mob_life = round(mob_life_attack, 2)

                        all_hero_hits += hero_hits

                        os.system('clear')

                        line()
                        # проверка на попадание героя по мобу
                        if hero_hits == 0.0:
                            print("\nГерой банально промазал. " + mob_name().title() + " ржет в стороне\n")
                        else:
                            print("\n{} бъет на {}НР\n".format(h.title(), hero_hits))

                        # рамка
                        frame()
                        ###############

                    # проверка на смерть моба и выдача плюшек
                    if int_mob_life <= 0:
                        from system.exper import new_exp, exper

                        new_exp()
                        hero_quantity_mob()

                        # Проверка на победу гг
                        os.system('clear')
                        line()
                        print("\nГерой победил злобного монстра!{:<80}".format(" ").upper())

                        # head
                        line()
                        print("{: <20}{} {: ^10}{: ^12}{} {: >20}".format("", h.title(), "", "", "Victory!!", ""))

                        loots()
                        logs()
                        test()

                        # запрос на новый бой, таймер
                        timer()

                # проверка на инициативу моба
                if hero_random <= mob_random:
                    os.system('clear')
                    mob_hits = round(mob_hit(), 2)
                    # запоминает удар моба
                    all_mob_hits += mob_hits

                    # удар моба
                    hero_life -= mob_hits
                    int_hero_life = round(hero_life, 2)

                    # сообщение про удар моба
                    line()
                    print("\n{: ^50}{} кусает героя на {}HP\n".format("", mob_name().title(), mob_hits))

                    # рамка + тестовый полигон
                    frame()
                    #######

                    # проверка на смерть героя
                    if int_hero_life <= 0:
                        os.system('clear')
                        line()
                        print("\n               " + str(h.upper()) + " погиб не выдержав побоев.\n".upper())

                        # head
                        line()
                        print(
                            "{: <20}{} {: ^10}{: ^12}{} {: >20}".format("", h.title(), "", "", mob_name().title(), ""))

                        logs()

                        # зачисление еденичку за убийство
                        hero_quantity_died()

                        # таймер на поиск нового моба
                        timer()