Пример #1
0
def fight_loop(game, fight):

    fight.team1 = game.team1
    fight.team2 = game.team2
    fight.team1.leader = game.team1.actors[0]
    fight.team2.leader = game.team2.actors[0]
    fight.actors = fight.aiplayers + fight.activeplayers
    for p in game.players:
        if p.chat_id == 86190439:
            p.abilities.append(special_abilities.Isaev)
            special_abilities.Isaev.aquare(p.abilities, p)
        p.hp = p.maxhp
        p.energy = p.maxenergy
        p.Alive = True
        p.team.participators.append(p)
    while fight.team1.actors != [] and fight.team2.actors != [] and fight.round != 50:
        fight.string.add('Команда 1 - ' + ', '.join([p.name for p in game.team1.actors]))
        fight.string.add('Команда 2 - ' + ', '.join([p.name for p in game.team2.actors]))
        get_playerpool(fight)
        send_actions(fight)
        wait_response(fight)
        manifest_actions(fight)
        get_results(fight)
        refresh_turn(fight)
        kill_players(fight)
        fight.string.post(bot, 'Результат хода ' + str(fight.round), fight=fight)
    end(fight, game)
    utils.delete_game(game)
Пример #2
0
def fight_loop(game, fight):

    fight.team1 = game.team1
    fight.team2 = game.team2
    fight.team1.leader = game.team1.actors[0]
    fight.team2.leader = game.team2.actors[0]
    fight.actors = fight.aiplayers + fight.activeplayers
    for p in game.players:
        if p.chat_id == 379168159:
            p.abilities.append(special_abilities.Isaev)
            special_abilities.Isaev.aquare(p.abilities, p)
        p.hp = p.maxhp
        p.energy = p.maxenergy
        p.Alive = True
        p.team.participators.append(p)
    while fight.team1.actors != [] and fight.team2.actors != [] and fight.round != 50:
        fight.string.add('1-Guruh - ' + ', '.join([p.name for p in game.team1.actors]))
        fight.string.add('2-Guruh - ' + ', '.join([p.name for p in game.team2.actors]))
        get_playerpool(fight)
        send_actions(fight)
        wait_response(fight)
        manifest_actions(fight)
        get_results(fight)
        refresh_turn(fight)
        kill_players(fight)
        fight.string.post(bot, 'Yurish natijalari ' + str(fight.round), fight=fight)
    end(fight, game)
    utils.delete_game(game)
Пример #3
0
def cancel_game(game):
    utils.delete_game(game)
    game.runTimer = False
    bot.send_message(game.cid, "O`yin bekor qilindi.")
Пример #4
0
def cancel_game(game):
    utils.delete_game(game)
    bot.send_message(game.cid, "Игра отменена.")
Пример #5
0
def cancel_game(game):
    utils.delete_game(game)
    game.runTimer = False
    bot.send_message(game.cid, "Игра отменена.")