Exemplo n.º 1
0
 def get_turn(self, fight):
     if float(self.hp) <= self.maxhp/2 and self.final is False:
         self.fight.string.add(u'\U00002757' + "| Ko`zlari qonga to`ldi "+self.name + '! U jahlda!')
         self.bonusdamage += self.teambonus - 1
         self.armorchance += 40
         self.accuracy += 2
         self.maxenergy += self.teambonus
         self.final = True
     meleecounter = 0
     for x in utils.get_other_team(self).actors:
         if x.weapon.Melee and x.Inmelee:
             meleecounter += 1
     # Застанен
     if self.Disabled:
         self.turn = 'disabled'
     # Влететь в мили
     elif not self.Inmelee:
         self.target = self.get_target()
         self.turn = 'rhino_tramp' + str(fight.round)
         self.Inmelee = True
     elif self.energy < 1:
         self.turn = 'rhino_rest' + str(fight.round)
     # Раскидать милишников
     elif float(meleecounter) >= len(utils.get_other_team(self).actors)/2 and random.randint(1,2) == 1 and self.circlecd < 1:
         self.turn = 'rhino_circle' + str(fight.round)
     # Отомстить за удар
     else:
         self.target = self.get_target()
         if not self.target.weapon.Melee and self.trumpcd < 1 or not self.target.Inmelee and self.trumpcd < 1:
             self.turn = 'rhino_tramp' + str(fight.round)
         elif self.target.Disabled:
             self.turn = 'rhino_stomp' + str(fight.round)
         else: self.turn = 'attack' + str(fight.round)
Exemplo n.º 2
0
    def get_turn(self, Fight):
        if self.Disabled:
            self.turn = 'disabled'
        elif self.firecounter > 1 and self.offfire != Fight.round:
            Fight.string.add(self.name + ' катается по земле и гасит пламя.')
            self.extinguish = True
            self.turn = 'skip' + str(Fight.round)

        elif self.Inmelee:
            self.target = utils.get_other_team(self).actors[random.randint(
                0,
                len(utils.get_other_team(self).actors) - 1)]
            for player in utils.get_other_team(self).actors:
                if 0 < player.hp < self.target.hp:
                    self.target = player
            if random.randint(1, 3) == 1 and self.energy > 1:
                self.target = utils.get_other_team(self).actors[random.randint(
                    0,
                    len(utils.get_other_team(self).actors) - 1)]
                self.turn = 'attack' + str(Fight.round)
            elif self.target.hp == 1 and self.energy > 0:
                self.tempaccuracy += 3
                self.turn = 'attack' + str(Fight.round)
            elif self.energy > 2:
                self.turn = 'attack' + str(Fight.round)
            elif self.firecounter > 0:
                Fight.string.add(self.name +
                                 ' катается по земле и гасит пламя.')
                self.extinguish = True
                self.turn = 'skip' + str(Fight.round)
            else:
                self.turn = 'dog_rest' + str(Fight.round)

        else:
            self.turn = 'move' + str(Fight.round)
Exemplo n.º 3
0
 def use(self, user):
     damage = random.randint(1, 2)
     enemycount = len(utils.get_other_team(user).actors)
     if enemycount > 2:
         target1 = utils.get_other_team(user).actors[random.randint(
             0, enemycount - 1)]
         newtargets = list(utils.get_other_team(user).actors)
         newtargets.remove(target1)
         target2 = newtargets[random.randint(0, enemycount - 2)]
         utils.damage(user, target1, damage, 'explosion')
         utils.damage(user, target2, damage, 'explosion')
         user.fight.string.add(
             u'\U0001F4A3' + " |" + user.name +
             ' 𝗕𝗮𝗹𝗹𝗶𝘀𝘁𝗶𝗸 𝗥𝗮𝗸𝗲𝘁𝗮🚀 𝗼𝘁𝗮𝘆𝗮𝗯𝗱𝗶❕ \n📟𝗣𝗼𝗿𝘁𝗹𝗮𝘀𝗵 𝗸𝘂𝗰𝗵𝗶: ' +
             str(damage) + '❕ \n📡𝗡𝗶𝘀𝗵𝗼𝗻𝗹𝗮𝗿: ' + target2.name + ' va ' +
             target1.name + '❕')
     else:
         for c in utils.get_other_team(user).actors:
             utils.damage(user, c, damage, 'melee')
         user.fight.string.add(
             u'\U0001F4A3' + " |" + user.name +
             ' 𝗕𝗮𝗹𝗹𝗶𝘀𝘁𝗶𝗸 𝗥𝗮𝗸𝗲𝘁𝗮🚀 𝗼𝘁𝗮𝘆𝗮𝗯𝗱𝗶!❕ \n📟𝗣𝗼𝗿𝘁𝗹𝗮𝘀𝗵 𝗸𝘂𝗰𝗵𝗶: ' +
             str(damage) + '❕')
     user.energy -= 0
     user.itemlist.remove(self)
Exemplo n.º 4
0
 def get_turn(self, fight):
     if float(self.hp) <= self.maxhp/2 and self.final is False:
         self.fight.string.add(u'\U00002757' + "| Кровь заливает глаза "+self.name + '! Он разъярен!')
         self.bonusdamage += self.teambonus - 1
         self.armorchance += 40
         self.accuracy += 2
         self.maxenergy += self.teambonus
         self.final = True
     meleecounter = 0
     for x in utils.get_other_team(self).actors:
         if x.weapon.Melee and x.Inmelee:
             meleecounter += 1
     # Застанен
     if self.Disabled:
         self.turn = 'disabled'
     # Влететь в мили
     elif not self.Inmelee:
         self.target = self.get_target()
         self.turn = 'rhino_tramp' + str(fight.round)
         self.Inmelee = True
     elif self.energy < 1:
         self.turn = 'rhino_rest' + str(fight.round)
     # Раскидать милишников
     elif float(meleecounter) >= len(utils.get_other_team(self).actors)/2 and random.randint(1,2) == 1 and self.circlecd < 1:
         self.turn = 'rhino_circle' + str(fight.round)
     # Отомстить за удар
     else:
         self.target = self.get_target()
         if not self.target.weapon.Melee and self.trumpcd < 1 or not self.target.Inmelee and self.trumpcd < 1:
             self.turn = 'rhino_tramp' + str(fight.round)
         elif self.target.Disabled:
             self.turn = 'rhino_stomp' + str(fight.round)
         else: self.turn = 'attack' + str(fight.round)
Exemplo n.º 5
0
    def get_turn(self, Fight):
        if self.Disabled:
            self.turn = 'disabled'
        elif self.firecounter > 1 and self.offfire != Fight.round:
                Fight.string.add(self.name + ' катается по земле и гасит пламя.')
                self.extinguish = True
                self.turn = 'skip' + str(Fight.round)

        elif self.Inmelee:
                self.target = utils.get_other_team(self).actors[
                random.randint(0, len(utils.get_other_team(self).actors) - 1)]
                for player in utils.get_other_team(self).actors:
                    if 0 < player.hp < self.target.hp:
                        self.target = player
                if random.randint(1, 3) == 1 and self.energy > 1:
                    self.target = utils.get_other_team(self).actors[random.randint(0,len(utils.get_other_team(self).actors) - 1)]
                    self.turn = 'attack' + str(Fight.round)
                elif self.target.hp == 1 and self.energy > 0:
                    self.tempaccuracy += 3
                    self.turn = 'attack' + str(Fight.round)
                elif self.energy > 2:
                    self.turn = 'attack' + str(Fight.round)
                elif self.firecounter > 0:
                    Fight.string.add(self.name + ' катается по земле и гасит пламя.')
                    self.extinguish = True
                    self.turn = 'skip' + str(Fight.round)
                else:
                    self.turn = 'dog_rest' + str(Fight.round)

        else:
            self.turn = 'move' + str(Fight.round)
Exemplo n.º 6
0
 def get_target(self):
     if self.highest_damagedealer != None and self.highest_damagedealer.Alive:
         target = self.highest_damagedealer
     else:
         target = utils.get_other_team(self).actors[random.randint(
             0,
             len(utils.get_other_team(self).actors) - 1)]
     return target
Exemplo n.º 7
0
    def use(self, user):
        enemycount = len(utils.get_other_team(user).actors)
        targets = []
        if enemycount > 2:
            target1 = utils.get_other_team(user).actors[random.randint(0, enemycount-1)]
            newtargets = list(utils.get_other_team(user).actors)
            newtargets.remove(target1)
            target2 = newtargets[random.randint(0, enemycount-2)]
            newtargets = list(utils.get_other_team(user).actors)
            newtargets.remove(target2)
            target1.firecounter += 1
            target1.offfire = user.fight.round + 2
            targets.append(target1)
            if random.randint(1, 3) > 1:
                target2.firecounter += 1
                target2.offfire = user.fight.round + 2
                targets.append(target2)

        else:
            utils.get_other_team(user).actors[0].firecounter += 1
            utils.get_other_team(user).actors[0].offfire = user.fight.round + 2
            targets.append(utils.get_other_team(user).actors[0])
            for c in utils.get_other_team(user).actors[1:]:
                if random.randint(1, 3) > 1:
                    c.firecounter += 1
                    c.offfire = user.fight.round + 2
                    targets.append(c)
        if targets:
            user.fight.string.add(u'\U0001F378' + " |" + user.name + ' кидает Коктейль Молотова! '
                                  + ', '.join([x.name for x in targets]) + ' в огне!')
        else:
            user.fight.string.add(u'\U0001F378' + " |" + user.name
                                  + ' кидает Коктейль Молотова, но ни по кому не попадает!')
        user.energy -= 2
        user.itemlist.remove(self)
Exemplo n.º 8
0
 def aiactionend(self, Fight):
     x = random.randint(1,5)
     print(str(x))
     if self.leader != None:
         if self.leader.hp <= 0 and x > 3 and len(utils.get_other_team(self).actors) > 0\
                 and len(utils.get_other_team(self).actors) >= len(self.team.actors) and self.hp > 0 and self.hp < 3:
             self.Alive = False
             Fight.string.add(u'\U00002620' + ' |' + self.name + ' трусливо сбегает с поля боя.')
             self.team.actors.remove(self)
             Fight.aiplayers.remove(self)
             Fight.actors.remove(self)
Exemplo n.º 9
0
 def aiactionend(self, Fight):
     x = random.randint(1,5)
     print(str(x))
     if self.leader != None:
         if self.leader.hp <= 0 and x > 3 and len(utils.get_other_team(self).actors) > 0\
                 and len(utils.get_other_team(self).actors) >= len(self.team.actors) and self.hp > 0 and self.hp < 3:
             self.Alive = False
             Fight.string.add(u'\U00002620' + ' |' + self.name + ' qo`rqoqlardek jang maydonidan qochib ketyabdi.')
             self.team.actors.remove(self)
             Fight.aiplayers.remove(self)
             Fight.actors.remove(self)
Exemplo n.º 10
0
    def special_first(self, user):
        if len(user.deadplayers) < len(user.team.deadplayers) + len(utils.get_other_team(user).deadplayers):
            print('O`lik aniqlandi! ')
            deadbodies = len(user.team.deadplayers) + len(utils.get_other_team(user).deadplayers) - len(user.deadplayers)
            user.deadplayers = list(user.team.deadplayers) + list(utils.get_other_team(user).deadplayers)

            while deadbodies != 0:
                deadbodies -= 1
                user.corpsecounter += 1
        if user.corpsecounter > 0 and Item_list.explode_corpse not in user.itemlist:
            user.itemlist.append(Item_list.explode_corpse)
Exemplo n.º 11
0
    def special_first(self, user):
        if len(user.deadplayers) < len(user.team.deadplayers) + len(utils.get_other_team(user).deadplayers):
            print('Обнаружены трупы! ')
            deadbodies = len(user.team.deadplayers) + len(utils.get_other_team(user).deadplayers) - len(user.deadplayers)
            user.deadplayers = list(user.team.deadplayers) + list(utils.get_other_team(user).deadplayers)

            while deadbodies != 0:
                deadbodies -= 1
                user.corpsecounter += 1
        if user.corpsecounter > 0 and Item_list.explode_corpse not in user.itemlist:
            user.itemlist.append(Item_list.explode_corpse)
Exemplo n.º 12
0
 def aiactionend(self, Fight):
     x = random.randint(1, 5)
     print(str(x))
     if self.leader != None:
         if self.leader.hp <= 0 and x > 3 and len(utils.get_other_team(self).actors) > 0\
                 and len(utils.get_other_team(self).actors) >= len(self.team.actors) and self.hp > 0 and self.hp < 3:
             self.Alive = False
             Fight.string.add(u'\U00002620' + ' |' + self.name +
                              ' трусливо сбегает с поля боя.')
             self.team.actors.remove(self)
             Fight.aiplayers.remove(self)
             Fight.actors.remove(self)
Exemplo n.º 13
0
def account_targets(player):
    if not player.weapon.Melee:
        player.targets = utils.get_other_team(player).actors
    else:
        if player.Inmelee:
            player.targets = utils.get_other_team(player).actors
        else:
            for p in utils.get_other_team(player).actors:
                if p.weapon.Melee and p.Inmelee:
                    player.targets.append(p)
        blockers = []
        for p in player.targets:
            if special_abilities.Blocker in p.abilities:
                blockers.append(p)
        if blockers:
            player.targets = blockers
Exemplo n.º 14
0
def account_targets(player):
    if not player.weapon.Melee:
        player.targets = utils.get_other_team(player).actors
    else:
        if player.Inmelee:
            player.targets = utils.get_other_team(player).actors
        else:
            for p in utils.get_other_team(player).actors:
                if p.weapon.Melee and p.Inmelee:
                    player.targets.append(p)
        blockers = []
        for p in player.targets:
            if special_abilities.Blocker in p.abilities:
                blockers.append(p)
        if blockers:
            player.targets = blockers
Exemplo n.º 15
0
 def useact(self, user):
     keyboard = types.InlineKeyboardMarkup()
     for p in utils.get_other_team(user).actors:
         callback_button = types.InlineKeyboardButton(text=p.name, callback_data='spitem' + str(p.chat_id))
         keyboard.add(callback_button)
     keyboard.add(types.InlineKeyboardButton(text='Отмена', callback_data=str('spitemcancel')))
     bot.send_message(user.chat_id, 'Выберите цель для кражи.', reply_markup=keyboard)
Exemplo n.º 16
0
 def useact(self, user):
     keyboard = types.InlineKeyboardMarkup()
     for p in utils.get_other_team(user).actors:
         callback_button = types.InlineKeyboardButton(text=p.name,callback_data='spitem' + str(p.chat_id))
         keyboard.add(callback_button)
     keyboard.add(types.InlineKeyboardButton(text='Отмена', callback_data=str('spitemcancel')))
     chance = (user.energy + 4)*10
     if chance > 100:
         chance = 100
     bot.send_message(user.chat_id, 'Выберите цель для ножа. Шанс попасть - ' + str(chance) + '%',reply_markup=keyboard)
Exemplo n.º 17
0
 def use(self, user):
     damage = random.randint(2, 3)
     enemycount = len(utils.get_other_team(user).actors)
     if enemycount > 2:
         target1 = utils.get_other_team(user).actors[random.randint(0, enemycount-1)]
         newtargets = list(utils.get_other_team(user).actors)
         newtargets.remove(target1)
         target2 = newtargets[random.randint(0, enemycount-2)]
         utils.damage(user, target1, damage, 'explosion')
         utils.damage(user, target2, damage, 'explosion')
         user.fight.string.add(u'\U0001F4A3' + " |" + user.name + ' кидает Гранату! Нанесено ' + str(damage)
                               + ' урона по ' + target2.name + ' и ' + target1.name + '.')
     else:
         for c in utils.get_other_team(user).actors:
             utils.damage(user, c, damage, 'melee')
         user.fight.string.add(u'\U0001F4A3' + " |" + user.name + ' кидает Гранату! Нанесено ' + str(
                               damage) + ' урона.')
     user.energy -= 2
     user.itemlist.remove(self)
Exemplo n.º 18
0
 def use(self, user):
     damage = random.randint(2, 3)
     enemycount = len(utils.get_other_team(user).actors)
     if enemycount > 2:
         target1 = utils.get_other_team(user).actors[random.randint(0, enemycount - 1)]
         newtargets = list(utils.get_other_team(user).actors)
         newtargets.remove(target1)
         target2 = newtargets[random.randint(0, enemycount - 2)]
         utils.damage(user, target1, damage, 'melee')
         utils.damage(user, target2, damage, 'melee')
         user.fight.string.add(u'\U0001F47F' + " |" + user.name + ' взрывает труп! Нанесено ' + str(damage)
                               + ' урона по ' + target2.name + ' и ' + target1.name + '.')
     else:
         for c in utils.get_other_team(user).actors:
             utils.damage(user, c, damage, 'melee')
         user.fight.string.add(u'\U0001F47F' + " |" + user.name + ' взрывает труп! Нанесено ' + str(
             damage) + ' урона.')
     user.corpsecounter -= 1
     user.itemlist.remove(self)
Exemplo n.º 19
0
 def circle(self):
     damage = self.bonusdamage*random.randint(1,2)
     self.energy -= 1
     self.circlecd = 3
     for x in utils.get_other_team(self).actors:
         if x.weapon.Melee and x.Inmelee:
             x.damagetaken += damage
             x.Inmelee = False
     self.Inmelee = False
     return u'\U0001F4A5' + "|" + self.name + ' отбрасывает всех противников, подошедших к нему вплотную, и наносит им ' \
            + str(damage) + ' урона!'
Exemplo n.º 20
0
 def circle(self):
     damage = self.bonusdamage * random.randint(1, 2)
     self.energy -= 1
     self.circlecd = 3
     for x in utils.get_other_team(self).actors:
         if x.weapon.Melee and x.Inmelee:
             x.damagetaken += damage
             x.Inmelee = False
     self.Inmelee = False
     return u'\U0001F4A5' + "|" + self.name + ' отбрасывает всех противников, подошедших к нему вплотную, и наносит им ' \
            + str(damage) + ' урона!'
Exemplo n.º 21
0
 def circle(self):
     damage = self.bonusdamage*random.randint(1,2)
     self.energy -= 1
     self.circlecd = 3
     for x in utils.get_other_team(self).actors:
         if x.weapon.Melee and x.Inmelee:
             x.damagetaken += damage
             x.Inmelee = False
     self.Inmelee = False
     return u'\U0001F4A5' + "|" + self.name + ' unga yaqinlashgan hamma raqiblarni itarib yuborib, ularga yetkazdi ' \
            + str(damage) + ' zarb!'
Exemplo n.º 22
0
 def useact(self, user):
     keyboard = types.InlineKeyboardMarkup()
     for p in utils.get_other_team(user).actors:
         callback_button = types.InlineKeyboardButton(
             text=p.name, callback_data='spitem' + str(p.chat_id))
         keyboard.add(callback_button)
     keyboard.add(
         types.InlineKeyboardButton(text='Bekor qilish',
                                    callback_data=str('spitemcancel')))
     bot.send_message(user.chat_id,
                      'Xaqoratlash uchun nishonni tanlang.',
                      reply_markup=keyboard)
Exemplo n.º 23
0
 def get_turn(self, fight):
     if float(self.hp) <= self.maxhp/2 and self.final is False:
         self.fight.string.add(u'\U00002757' + "| In-Yan♋️ kuchlari qo`shilishi bilan "+self.name + ' elementlar kuchiga ega bo`ldi!')
         self.bonusdamage += self.teambonus - 1
         self.armorchance += 30
         self.accuracy += 3
         self.maxenergy += self.teambonus
         self.final = True
     meleecounter = 0
     for x in utils.get_other_team(self).actors:
         if x.weapon.Melee and x.Inmelee:
             meleecounter += 1
Exemplo n.º 24
0
 def useact(self, user):
     keyboard = types.InlineKeyboardMarkup()
     for p in utils.get_other_team(user).actors:
         callback_button = types.InlineKeyboardButton(
             text=p.name, callback_data='spitem' + str(p.chat_id))
         keyboard.add(callback_button)
     keyboard.add(
         types.InlineKeyboardButton(text='Отмена',
                                    callback_data=str('spitemcancel')))
     bot.send_message(user.chat_id,
                      'Выберите цель для кражи.',
                      reply_markup=keyboard)
Exemplo n.º 25
0
    def get_turn(self, Fight):
        if float(self.hp) <= self.maxhp / 2 and self.final is False:
            self.fight.string.add(u'\U00002757' + "|" + self.name +
                                  ' злобно рычит!')
            self.bonusdamage += self.teambonus - 1
            self.armor += 2
            self.armorchance += 20
            self.accuracy += 2
            self.maxenergy += self.teambonus
            self.final = True
        if self.Disabled:
            self.turn = 'disabled'
        elif self.howlcounter is 0 and self.energy > 0 and random.randint(1,3) == 1 and Fight.round != 1 and len(self.team.actors) != 1 \
                and not any(x.energy==0 for x in self.team.actors) and self.hp != 1:
            self.turn = 'howl' + str(Fight.round)
            self.energy -= 1

        elif self.Inmelee:
            self.target = utils.get_other_team(self).actors[random.randint(
                0,
                len(utils.get_other_team(self).actors) - 1)]
            for player in utils.get_other_team(self).actors:
                if 0 < player.hp < self.target.hp:
                    self.target = player
            if random.randint(1, 3) == 1 and self.energy > 1:
                self.target = utils.get_other_team(self).actors[random.randint(
                    0,
                    len(utils.get_other_team(self).actors) - 1)]
                self.turn = 'attack' + str(Fight.round)
            elif self.target.hp == 1 and self.energy > 0:
                self.tempaccuracy += 3
                self.turn = 'attack' + str(Fight.round)
            elif self.energy > 2:
                self.turn = 'attack' + str(Fight.round)

            else:
                self.turn = 'dog_rest' + str(Fight.round)

        else:
            self.turn = 'move' + str(Fight.round)
Exemplo n.º 26
0
 def useact(self, user):
     keyboard = types.InlineKeyboardMarkup()
     for p in utils.get_other_team(user).actors:
         callback_button = types.InlineKeyboardButton(text=p.name,
                                                      callback_data='info' +
                                                      str(p.chat_id))
         keyboard.add(callback_button)
     keyboard.add(
         types.InlineKeyboardButton(text='Bekor qilish',
                                    callback_data=str('infocancel')))
     bot.send_message(user.chat_id,
                      'Ma`lumotni olishni hohlagan nishonizni tanlang.',
                      reply_markup=keyboard)
Exemplo n.º 27
0
 def use(self, user):
     damage = random.randint(2, 3)
     enemycount = len(utils.get_other_team(user).actors)
     if enemycount > 2:
         target1 = utils.get_other_team(user).actors[random.randint(
             0, enemycount - 1)]
         newtargets = list(utils.get_other_team(user).actors)
         newtargets.remove(target1)
         target2 = newtargets[random.randint(0, enemycount - 2)]
         utils.damage(user, target1, damage, 'explosion')
         utils.damage(user, target2, damage, 'explosion')
         user.fight.string.add(u'\U0001F4A3' + " |" + user.name +
                               ' Granatani otdi! Yetkazildi ' +
                               str(damage) + ' zarb - ' + target2.name +
                               ' va ' + target1.name + '.')
     else:
         for c in utils.get_other_team(user).actors:
             utils.damage(user, c, damage, 'melee')
         user.fight.string.add(u'\U0001F4A3' + " |" + user.name +
                               ' Granatani otdi! Yetkazildi ' +
                               str(damage) + ' zarb.')
     user.energy -= 2
     user.itemlist.remove(self)
Exemplo n.º 28
0
 def use(self, user):
     damage = random.randint(2, 3)
     enemycount = len(utils.get_other_team(user).actors)
     if enemycount > 2:
         target1 = utils.get_other_team(user).actors[random.randint(
             0, enemycount - 1)]
         newtargets = list(utils.get_other_team(user).actors)
         newtargets.remove(target1)
         target2 = newtargets[random.randint(0, enemycount - 2)]
         utils.damage(user, target1, damage, 'melee')
         utils.damage(user, target2, damage, 'melee')
         user.fight.string.add(u'\U0001F47F' + " |" + user.name +
                               ' o`likni portlatayabdi! Yetkaziladi ' +
                               str(damage) + ' zarb ' + target2.name +
                               ' va ' + target1.name + 'ga.')
     else:
         for c in utils.get_other_team(user).actors:
             utils.damage(user, c, damage, 'melee')
         user.fight.string.add(u'\U0001F47F' + " |" + user.name +
                               ' o`likni portlatayabdi! Yetkaziladi ' +
                               str(damage) + ' zarb.')
     user.corpsecounter -= 1
     user.itemlist.remove(self)
Exemplo n.º 29
0
 def use(self, user):
     damage = random.randint(2, 3)
     enemycount = len(utils.get_other_team(user).actors)
     if enemycount > 2:
         target1 = utils.get_other_team(user).actors[random.randint(
             0, enemycount - 1)]
         newtargets = list(utils.get_other_team(user).actors)
         newtargets.remove(target1)
         target2 = newtargets[random.randint(0, enemycount - 2)]
         utils.damage(user, target1, damage, 'explosion')
         utils.damage(user, target2, damage, 'explosion')
         user.fight.string.add(u'\U0001F4A3' + " |" + user.name +
                               ' кидает Гранату! Нанесено ' + str(damage) +
                               ' урона по ' + target2.name + ' и ' +
                               target1.name + '.')
     else:
         for c in utils.get_other_team(user).actors:
             utils.damage(user, c, damage, 'melee')
         user.fight.string.add(u'\U0001F4A3' + " |" + user.name +
                               ' кидает Гранату! Нанесено ' + str(damage) +
                               ' урона.')
     user.energy -= 2
     user.itemlist.remove(self)
Exemplo n.º 30
0
 def use(self, user):
     damage = random.randint(2, 3)
     enemycount = len(utils.get_other_team(user).actors)
     if enemycount > 2:
         target1 = utils.get_other_team(user).actors[random.randint(
             0, enemycount - 1)]
         newtargets = list(utils.get_other_team(user).actors)
         newtargets.remove(target1)
         target2 = newtargets[random.randint(0, enemycount - 2)]
         utils.damage(user, target1, damage, 'melee')
         utils.damage(user, target2, damage, 'melee')
         user.fight.string.add(u'\U0001F47F' + " |" + user.name +
                               ' взрывает труп! Нанесено ' + str(damage) +
                               ' урона по ' + target2.name + ' и ' +
                               target1.name + '.')
     else:
         for c in utils.get_other_team(user).actors:
             utils.damage(user, c, damage, 'melee')
         user.fight.string.add(u'\U0001F47F' + " |" + user.name +
                               ' взрывает труп! Нанесено ' + str(damage) +
                               ' урона.')
     user.corpsecounter -= 1
     user.itemlist.remove(self)
Exemplo n.º 31
0
 def useact(self, user):
     keyboard = types.InlineKeyboardMarkup()
     for p in utils.get_other_team(user).actors:
         callback_button = types.InlineKeyboardButton(
             text=p.name, callback_data='spitem' + str(p.chat_id))
         keyboard.add(callback_button)
     keyboard.add(
         types.InlineKeyboardButton(text='Bekor qilish',
                                    callback_data=str('spitemcancel')))
     chance = utils.get_hit_chance(user, 0)
     bot.send_message(
         user.chat_id,
         'Nayza uchun nishonni tanlang. Tegish ehtimolligi - ' +
         str(int(chance)) + '%',
         reply_markup=keyboard)
Exemplo n.º 32
0
    def get_turn(self, Fight):
        if float(self.hp)<=self.maxhp/2 and self.final is False:
            self.fight.string.add(u'\U00002757' + "|"+self.name + ' злобно рычит!')
            self.bonusdamage += self.teambonus - 1
            self.armor += 2
            self.armorchance += 20
            self.accuracy += 2
            self.maxenergy += self.teambonus
            self.final = True
        if self.Disabled:
            self.turn = 'disabled'
        elif self.howlcounter is 0 and self.energy > 0 and random.randint(1,3) == 1 and Fight.round != 1 and len(self.team.actors) != 1 \
                and not any(x.energy==0 for x in self.team.actors) and self.hp != 1:
            self.turn = 'howl' + str(Fight.round)
            self.energy -= 1

        elif self.Inmelee:
                self.target = utils.get_other_team(self).actors[
                random.randint(0, len(utils.get_other_team(self).actors) - 1)]
                for player in utils.get_other_team(self).actors:
                    if 0 < player.hp < self.target.hp:
                        self.target = player
                if random.randint(1,3) == 1 and self.energy > 1:
                    self.target = utils.get_other_team(self).actors[random.randint(0,len(utils.get_other_team(self).actors) - 1)]
                    self.turn = 'attack' + str(Fight.round)
                elif self.target.hp == 1 and self.energy > 0:
                    self.tempaccuracy += 3
                    self.turn = 'attack' + str(Fight.round)
                elif self.energy > 2:
                    self.turn = 'attack' + str(Fight.round)

                else:
                    self.turn = 'dog_rest' + str(Fight.round)

        else:
            self.turn = 'move' + str(Fight.round)
Exemplo n.º 33
0
 def useact(self, user):
     keyboard = types.InlineKeyboardMarkup()
     for p in utils.get_other_team(user).actors:
         callback_button = types.InlineKeyboardButton(
             text=p.name, callback_data='spitem' + str(p.chat_id))
         keyboard.add(callback_button)
     keyboard.add(
         types.InlineKeyboardButton(text='Bekor qilish',
                                    callback_data=str('spitemcancel')))
     chance = (user.energy + 4) * 10
     if chance > 100:
         chance = 100
     bot.send_message(user.chat_id,
                      'Pichoq uchun nishonni tanlang. Tegish ehtimoli - ' +
                      str(chance) + '%',
                      reply_markup=keyboard)
Exemplo n.º 34
0
def manifest_first_q(fight):
    for p in fight.actors:
        if p.turn == 'evade' + str(p.fight.round):
            p.fight.string.add(u'\U0001F4A8' + "|" + p.name + ' chetlashmoqda.')
            p.dodgecd += 5
            for n in utils.get_other_team(p).actors:
                if n.target == p:
                    n.tempaccuracy -= 5
        elif p.turn[0:4] == 'item':
            for i in p.itemlist:
                if p.turn[0:7] == i.id:
                    i.usefirst(p)
                    break
        for a in p.abilities:
            a.special_first(a, p)
        p.weapon.special_first(p)
Exemplo n.º 35
0
def manifest_first_q(fight):
    for p in fight.actors:
        if p.turn == 'evade' + str(p.fight.round):
            p.fight.string.add(u'\U0001F4A8' + "|" + p.name + ' перекатывается.')
            p.dodgecd += 5
            for n in utils.get_other_team(p).actors:
                if n.target == p:
                    n.tempaccuracy -= 5
        elif p.turn[0:4] == 'item':
            for i in p.itemlist:
                if p.turn[0:7] == i.id:
                    i.usefirst(p)
                    break
        for a in p.abilities:
            a.special_first(a, p)
        p.weapon.special_first(p)
Exemplo n.º 36
0
    def use(self, user):
        enemycount = len(utils.get_other_team(user).actors)
        targets = []
        if enemycount > 2:
            target1 = utils.get_other_team(user).actors[random.randint(
                0, enemycount - 1)]
            newtargets = list(utils.get_other_team(user).actors)
            newtargets.remove(target1)
            target2 = newtargets[random.randint(0, enemycount - 2)]
            newtargets = list(utils.get_other_team(user).actors)
            newtargets.remove(target2)
            target1.firecounter += 2
            target1.offfire = user.fight.round + 2
            targets.append(target1)
            if random.randint(1, 3) > 1:
                target2.firecounter += 1
                target2.offfire = user.fight.round + 2
                targets.append(target2)

        else:
            utils.get_other_team(user).actors[0].firecounter += 1
            utils.get_other_team(user).actors[0].offfire = user.fight.round + 2
            targets.append(utils.get_other_team(user).actors[0])
            for c in utils.get_other_team(user).actors[1:]:
                if random.randint(1, 3) > 1:
                    c.firecounter += 1
                    c.offfire = user.fight.round + 2
                    targets.append(c)
        if targets:
            user.fight.string.add('🔥' + " |" + user.name +
                                  ' 𝗝𝗮𝘅𝗮𝗻𝗻𝗮𝗺 𝗢𝗹𝗼𝘃𝗶𝗻𝗶🌋 chaqirmoqda! ' +
                                  ', '.join([x.name
                                             for x in targets]) + ' yonmoqda!')
        else:
            user.fight.string.add(
                '🔥' + " |" + user.name +
                ' butun maydonni🌋 olovga to`ldirmoqda, lekin hech kimga yonmayabdi!'
            )
        user.energy -= 2
        user.itemlist.remove(self)
Exemplo n.º 37
0
 def useact(self, user):
     keyboard = types.InlineKeyboardMarkup()
     for p in utils.get_other_team(user).actors:
         callback_button = types.InlineKeyboardButton(
             text=p.name, callback_data='spitem' + str(p.chat_id))
         keyboard.add(callback_button)
     keyboard.add(
         types.InlineKeyboardButton(text='Отмена',
                                    callback_data=str('spitemcancel')))
     chance = (user.energy + 4) * 10
     if chance > 100:
         chance = 100
     bot.send_message(user.chat_id,
                      'Выберите цель для ножа. Шанс попасть - ' +
                      str(chance) + '%',
                      reply_markup=keyboard)
Exemplo n.º 38
0
    def use(self, user):
        enemycount = len(utils.get_other_team(user).actors)
        targets = []
        if enemycount > 2:
            target1 = utils.get_other_team(user).actors[random.randint(
                0, enemycount - 1)]
            newtargets = list(utils.get_other_team(user).actors)
            newtargets.remove(target1)
            target2 = newtargets[random.randint(0, enemycount - 2)]
            newtargets = list(utils.get_other_team(user).actors)
            newtargets.remove(target2)
            target1.firecounter += 1
            target1.offfire = user.fight.round + 2
            targets.append(target1)
            if random.randint(1, 3) > 1:
                target2.firecounter += 1
                target2.offfire = user.fight.round + 2
                targets.append(target2)

        else:
            utils.get_other_team(user).actors[0].firecounter += 1
            utils.get_other_team(user).actors[0].offfire = user.fight.round + 2
            targets.append(utils.get_other_team(user).actors[0])
            for c in utils.get_other_team(user).actors[1:]:
                if random.randint(1, 3) > 1:
                    c.firecounter += 1
                    c.offfire = user.fight.round + 2
                    targets.append(c)
        if targets:
            user.fight.string.add(u'\U0001F378' + " |" + user.name +
                                  ' кидает Коктейль Молотова! ' +
                                  ', '.join([x.name
                                             for x in targets]) + ' в огне!')
        else:
            user.fight.string.add(
                u'\U0001F378' + " |" + user.name +
                ' кидает Коктейль Молотова, но ни по кому не попадает!')
        user.energy -= 2
        user.itemlist.remove(self)
Exemplo n.º 39
0
    def use(self, user):
        enemycount = len(utils.get_other_team(user).actors)
        targets = []
        if enemycount > 2:
            target1 = utils.get_other_team(user).actors[random.randint(
                0, enemycount - 1)]
            newtargets = list(utils.get_other_team(user).actors)
            newtargets.remove(target1)
            target2 = newtargets[random.randint(0, enemycount - 2)]
            newtargets = list(utils.get_other_team(user).actors)
            newtargets.remove(target2)
            target1.firecounter += 1
            target1.offfire = user.fight.round + 2
            targets.append(target1)
            if random.randint(1, 3) > 1:
                target2.firecounter += 1
                target2.offfire = user.fight.round + 2
                targets.append(target2)

        else:
            utils.get_other_team(user).actors[0].firecounter += 1
            utils.get_other_team(user).actors[0].offfire = user.fight.round + 2
            targets.append(utils.get_other_team(user).actors[0])
            for c in utils.get_other_team(user).actors[1:]:
                if random.randint(1, 3) > 1:
                    c.firecounter += 1
                    c.offfire = user.fight.round + 2
                    targets.append(c)
        if targets:
            user.fight.string.add(u'\U0001F378' + " |" + user.name +
                                  ' Molotov koktelini otayabdi! ' +
                                  ', '.join([x.name
                                             for x in targets]) + ' yonmoqda!')
        else:
            user.fight.string.add(
                u'\U0001F378' + " |" + user.name +
                ' Molotov koktelini otayabdi, lekin hech kimga tegmayabdi!')
        user.energy -= 2
        user.itemlist.remove(self)
Exemplo n.º 40
0
    def get_turn(self, fight):
        self.get_target()
        readycounter = 0
        ranged = False
        for x in utils.get_other_team(self).actors:
            if x in self.targets and x.energy == x.maxenergy:
                readycounter += 1
            if not x.weapon.Melee:
                ranged = True
        # Застанен
        if self.Disabled:
            self.target = None
            self.turn = 'disabled'

        # Тушиться
        elif self.firecounter > 1 and special_abilities.Gasmask not in self.abilities or self.firecounter > 0 and not self.Inmelee and special_abilities.Gasmask not in self.abilities or self.firecounter > 0 and self.energy < 2 and special_abilities.Gasmask not in self.abilities:
            self.target = None
            self.turn = 'skip' + str(fight.round)

        # Подойти в мили
        elif not self.Inmelee and not self.targets:
            if Item_list.grenade in self.itemlist:
                self.target = None
                self.turn = Item_list.grenade.id
            elif random.randint(
                    1, 2) == 1 and Item_list.throwingknife in self.itemlist:
                self.itemtarget = utils.get_other_team(self).actors[
                    random.randint(0,
                                   len(utils.get_other_team(self).actors) - 1)]
                self.turn = Item_list.throwingknife.id
            elif self.weapon == Weapon_list.knife and Item_list.throwingknife in self.itemlist:
                self.itemtarget = utils.get_other_team(self).actors[
                    random.randint(0,
                                   len(utils.get_other_team(self).actors) - 1)]
                self.turn = Item_list.throwingknife.id
            elif random.randint(
                    1, 2) == 1 and Item_list.firegrenade in self.itemlist:
                self.target = None
                self.turn = Item_list.firegrenade.id
            elif self.energy != self.maxenergy and not ranged:
                self.target = None
                self.turn = 'reload' + str(fight.round)
            else:
                self.target = None
                self.turn = 'move' + str(fight.round)
        # Спецатаки
        # Копье
        elif float(readycounter) >= len(self.targets)/2 and self.weapon == Weapon_list.spear and self.firecounter < 1 \
                and self.energy > 3 and random.randint(1, 3) != 1 and self.ability_ready and \
                        self.target.stuncounter == 0 and self.target.weapon != Weapon_list.sniper:
            if self.countercd == 0:
                self.target = None
                self.turn = 'aim'
                self.weapon.special(self, None)
            else:
                self.ability_ready = False
                self.get_turn(self.fight)
        # Цепь
        elif self.target.energy < 2 and self.weapon == Weapon_list.chain and random.randint(
                1, 4) != 1 and self.energy > 3 and self.ability_ready:
            print('drop')
            if self.dropcd == 0:
                self.turn = 'weaponspecial'
                self.weapon.special(self, self.target.chat_id)
            else:
                self.ability_ready = False
                self.get_turn(self.fight)
        # Кувалда
        elif self.target.maxenergy - self.target.energy > 1 and self.weapon == Weapon_list.sledge and random.randint(
                1, 4) != 1 and self.energy > 3 and self.ability_ready:
            if self.crushcd == 0:
                self.turn = 'weaponspecial'
                self.weapon.special(self, self.target.chat_id)
            else:
                self.ability_ready = False
                self.get_turn(self.fight)

        # Уворот
        elif self.target.stuncounter == 0 and self.target.weapon != Weapon_list.sniper and self.dodge_ready:
            if float(readycounter) >= len(self.targets)/2 and random.randint(1, 3) != 1 \
                    and self.dodgecd == 0 and self.energy != self.maxenergy and self.hp <= 2 or float(readycounter) >= len(self.targets)/2 \
                    and self.dodgecd == 0 and self.hp == 1:
                self.target = None
                self.turn = 'dodge' + str(fight.round)
            else:
                self.dodge_ready = False
                self.get_turn(self.fight)

        # Метательный нож
        elif self.energy > 3 and Item_list.throwingknife in self.itemlist and self.target.energy < 2:
            self.itemtarget = self.target
            self.target = None
            self.turn = Item_list.throwingknife.id

        elif 1 < self.energy < 4 and Item_list.firegrenade in self.itemlist and self.target.energy < 2:
            self.target = None
            self.turn = Item_list.firegrenade.id

        # Удар (Если больше 2 энергии или 50% если больше 1 энергии или есть энергия, 1 хп и тебя готовы ударить)
        elif self.energy > 2 or random.randint(
                1, 2
        ) == 1 and self.energy > 1 or readycounter and self.hp == 1 and self.energy > 0:
            self.turn = 'attack' + str(fight.round)

        # Отдых
        else:
            self.target = None
            self.turn = 'reload' + str(fight.round)
Exemplo n.º 41
0
 def get_target(self):
     if self.highest_damagedealer != None and self.highest_damagedealer.Alive:
         target = self.highest_damagedealer
     else:
         target = utils.get_other_team(self).actors[random.randint(0, len(utils.get_other_team(self).actors) - 1)]
     return target
Exemplo n.º 42
0
    def get_turn(self, fight):
        self.get_target()
        readycounter = 0
        ranged = False
        for x in utils.get_other_team(self).actors:
            if x in self.targets and x.energy == x.maxenergy:
                readycounter += 1
            if not x.weapon.Melee:
                ranged = True
        # Застанен
        if self.Disabled:
            self.target = None
            self.turn = 'disabled'

        # Тушиться
        elif self.firecounter > 1 and special_abilities.Gasmask not in self.abilities or self.firecounter > 0 and not self.Inmelee and special_abilities.Gasmask not in self.abilities or self.firecounter > 0 and self.energy < 2 and special_abilities.Gasmask not in self.abilities:
            self.target = None
            self.turn = 'skip' + str(fight.round)

        # Подойти в мили
        elif not self.Inmelee and not self.targets:
            if Item_list.grenade in self.itemlist:
                self.target = None
                self.turn = Item_list.grenade.id
            elif random.randint(1,2) == 1 and Item_list.throwingknife in self.itemlist:
                self.itemtarget = utils.get_other_team(self).actors[random.randint(0, len(utils.get_other_team(self).actors) - 1)]
                self.turn = Item_list.throwingknife.id
            elif self.weapon == Weapon_list.knife and Item_list.throwingknife in self.itemlist:
                self.itemtarget = utils.get_other_team(self).actors[
                    random.randint(0, len(utils.get_other_team(self).actors) - 1)]
                self.turn = Item_list.throwingknife.id
            elif random.randint(1,2) == 1 and Item_list.firegrenade in self.itemlist:
                self.target = None
                self.turn = Item_list.firegrenade.id
            elif self.energy != self.maxenergy and not ranged:
                self.target = None
                self.turn = 'reload' + str(fight.round)
            else:
                self.target = None
                self.turn = 'move' + str(fight.round)
        # Спецатаки
        # Копье
        elif float(readycounter) >= len(self.targets)/2 and self.weapon == Weapon_list.spear and self.firecounter < 1 \
                and self.energy > 3 and random.randint(1, 3) != 1 and self.ability_ready and \
                        self.target.stuncounter == 0 and self.target.weapon != Weapon_list.sniper:
            if self.countercd == 0:
                self.target = None
                self.turn = 'aim'
                self.weapon.special(self, None)
            else:
                self.ability_ready = False
                self.get_turn(self.fight)
        # Цепь
        elif self.target.energy < 2 and self.weapon == Weapon_list.chain and random.randint(1, 4) != 1 and self.energy > 3 and self.ability_ready:
            print('drop')
            if self.dropcd == 0:
                self.turn = 'weaponspecial'
                self.weapon.special(self, self.target.chat_id)
            else:
                self.ability_ready = False
                self.get_turn(self.fight)
        # Кувалда
        elif self.target.maxenergy - self.target.energy > 1 and self.weapon == Weapon_list.sledge and random.randint(1,
                                                                                            4) != 1 and self.energy > 3 and self.ability_ready:
                if self.crushcd == 0:
                    self.turn = 'weaponspecial'
                    self.weapon.special(self, self.target.chat_id)
                else:
                    self.ability_ready = False
                    self.get_turn(self.fight)

        # Уворот
        elif self.target.stuncounter == 0 and self.target.weapon != Weapon_list.sniper and self.dodge_ready:
            if float(readycounter) >= len(self.targets)/2 and random.randint(1, 3) != 1 \
                    and self.dodgecd == 0 and self.energy != self.maxenergy and self.hp <= 2 or float(readycounter) >= len(self.targets)/2 \
                    and self.dodgecd == 0 and self.hp == 1:
                self.target = None
                self.turn = 'dodge' + str(fight.round)
            else:
                self.dodge_ready = False
                self.get_turn(self.fight)

        # Метательный нож
        elif self.energy > 3 and Item_list.throwingknife in self.itemlist and self.target.energy < 2:
            self.itemtarget = self.target
            self.target = None
            self.turn = Item_list.throwingknife.id

        elif 1 < self.energy < 4 and Item_list.firegrenade in self.itemlist and self.target.energy < 2:
            self.target = None
            self.turn = Item_list.firegrenade.id

        # Удар (Если больше 2 энергии или 50% если больше 1 энергии или есть энергия, 1 хп и тебя готовы ударить)
        elif self.energy > 2 or random.randint(1, 2) == 1 and self.energy > 1 or readycounter and self.hp==1 and self.energy > 0:
            self.turn = 'attack' + str(fight.round)

        # Отдых
        else:
            self.target = None
            self.turn = 'reload' + str(fight.round)
Exemplo n.º 43
0
def send_action(p, fight):
    keyboard = types.InlineKeyboardMarkup()
    if p.energy > 0:
        if not p.weapon.Melee:
            callback_button1 = types.InlineKeyboardButton(text="Выстрел", callback_data=str('attack'
                                                                                            + str(fight.round)))
            callback_button2 = types.InlineKeyboardButton(text="Перезарядка", callback_data=str('reload'
                                                                                                + str(fight.round)))
            keyboard.add(callback_button1, callback_button2)
        else:
            if p.Inmelee:
                callback_button1 = types.InlineKeyboardButton(text="Удар",
                                                              callback_data=str('attack' + str(fight.round)))
                callback_button2 = types.InlineKeyboardButton(text="Отдышаться",
                                                              callback_data=str('reload' + str(fight.round)))
                keyboard.add(callback_button1, callback_button2)
            else:
                if not p.targets:
                    callback_button1 = types.InlineKeyboardButton(text="Подойти",
                                                                  callback_data=str('move' + str(fight.round)))
                    callback_button2 = types.InlineKeyboardButton(text="Отдышаться",
                                                                  callback_data=str('reload' + str(fight.round)))
                    keyboard.add(callback_button1, callback_button2)
                elif len(p.targets) < len(utils.get_other_team(p).actors):
                    callback_button1 = types.InlineKeyboardButton(text="Удар",
                                                                  callback_data=str('attack' + str(fight.round)))
                    callback_button2 = types.InlineKeyboardButton(text="Отдышаться",
                                                                  callback_data=str('reload' + str(fight.round)))
                    keyboard.add(callback_button1, callback_button2)
                    callback_button1 = types.InlineKeyboardButton(text="Подойти",
                                                                  callback_data=str('move' + str(fight.round)))
                    keyboard.add(callback_button1)
                else:
                    callback_button1 = types.InlineKeyboardButton(text="Удар",
                                                                  callback_data=str('attack' + str(fight.round)))
                    callback_button2 = types.InlineKeyboardButton(text="Отдышаться",
                                                                  callback_data=str('reload' + str(fight.round)))
                    keyboard.add(callback_button1, callback_button2)
    elif special_abilities.Zombie in p.abilities:
        if not p.targets:
            callback_button1 = types.InlineKeyboardButton(text="Подойти",
                                                          callback_data=str('move' + str(fight.round)))
            keyboard.add(callback_button1)
        elif len(p.targets) < len(utils.get_other_team(p).actors):
            callback_button1 = types.InlineKeyboardButton(text="Удар",
                                                          callback_data=str('attack' + str(fight.round)))
            keyboard.add(callback_button1)
            callback_button1 = types.InlineKeyboardButton(text="Подойти",
                                                          callback_data=str('move' + str(fight.round)))
            keyboard.add(callback_button1)
        else:
            callback_button1 = types.InlineKeyboardButton(text="Удар",
                                                          callback_data=str('attack' + str(fight.round)))
            keyboard.add(callback_button1)
    else:
        if not p.weapon.Melee:
            callback_button2 = types.InlineKeyboardButton(text="Перезарядка",
                                                          callback_data=str('reload' + str(fight.round)))
            keyboard.add(callback_button2)
        else:
            callback_button2 = types.InlineKeyboardButton(text="Отдышаться",
                                                          callback_data=str('reload' + str(fight.round)))

            keyboard.add(callback_button2)

    if p.dodgecd > 0:
        keyboard.add(types.InlineKeyboardButton(text='Инфо', callback_data=str('info')))
    else:
        keyboard.add(types.InlineKeyboardButton(text='Перекат', callback_data=str('evade' + str(fight.round))),
                     types.InlineKeyboardButton(text='Инфо', callback_data=str('info')))

    if not p.Armed:
        if len(p.itemlist) > 2:
            callback_button1 = types.InlineKeyboardButton(text="Дополнительно",
                                                          callback_data=str('inventory' + str(fight.round)))
            keyboard.add(callback_button1)
        else:
            for c in p.itemlist:
                if p.energy >= 2:
                    keyboard.add(types.InlineKeyboardButton(text=c.name, callback_data=str(c.id + str(fight.round))))
                elif c.energy is False:
                    keyboard.add(types.InlineKeyboardButton(text=c.name, callback_data=str(c.id + str(fight.round))))

    else:
        callback_button1 = types.InlineKeyboardButton(text="Отменить",
                                                      callback_data=str('release' + str(fight.round)))
        keyboard.add(callback_button1)
    if p.lostweapon is not None:
        keyboard.add(types.InlineKeyboardButton(text='Подобрать оружие', callback_data=str('take' + str(fight.round))))
    if p.firecounter > 0:
        keyboard.add(types.InlineKeyboardButton(text='Потушиться', callback_data=str('skip' + str(fight.round))))
    else:
        keyboard.add(types.InlineKeyboardButton(text='Пропустить', callback_data=str('skip' + str(fight.round))))
    p.choicemessage = bot.send_message(p.chat_id, utils.player_turn_info(p).string, reply_markup=keyboard)
    p.info.clear()
Exemplo n.º 44
0
def send_action(p, fight):
    account_targets(p)
    keyboard = types.InlineKeyboardMarkup()
    if p.energy > 0:
        if not p.weapon.Melee:
            callback_button1 = types.InlineKeyboardButton(
                text="Выстрел", callback_data=str('attack' + str(fight.round)))
            callback_button2 = types.InlineKeyboardButton(
                text="Перезарядка",
                callback_data=str('reload' + str(fight.round)))
            keyboard.add(callback_button1, callback_button2)
        else:
            if p.Inmelee:
                callback_button1 = types.InlineKeyboardButton(
                    text="Удар",
                    callback_data=str('attack' + str(fight.round)))
                callback_button2 = types.InlineKeyboardButton(
                    text="Отдышаться",
                    callback_data=str('reload' + str(fight.round)))
                keyboard.add(callback_button1, callback_button2)
            else:
                if not p.targets:
                    callback_button1 = types.InlineKeyboardButton(
                        text="Подойти",
                        callback_data=str('move' + str(fight.round)))
                    callback_button2 = types.InlineKeyboardButton(
                        text="Отдышаться",
                        callback_data=str('reload' + str(fight.round)))
                    keyboard.add(callback_button1, callback_button2)
                elif len(p.targets) < len(utils.get_other_team(p).actors):
                    callback_button1 = types.InlineKeyboardButton(
                        text="Удар",
                        callback_data=str('attack' + str(fight.round)))
                    callback_button2 = types.InlineKeyboardButton(
                        text="Отдышаться",
                        callback_data=str('reload' + str(fight.round)))
                    keyboard.add(callback_button1, callback_button2)
                    callback_button1 = types.InlineKeyboardButton(
                        text="Подойти",
                        callback_data=str('move' + str(fight.round)))
                    keyboard.add(callback_button1)
                else:
                    callback_button1 = types.InlineKeyboardButton(
                        text="Удар",
                        callback_data=str('attack' + str(fight.round)))
                    callback_button2 = types.InlineKeyboardButton(
                        text="Отдышаться",
                        callback_data=str('reload' + str(fight.round)))
                    keyboard.add(callback_button1, callback_button2)
    elif special_abilities.Zombie in p.abilities:
        if not p.targets:
            callback_button1 = types.InlineKeyboardButton(
                text="Подойти", callback_data=str('move' + str(fight.round)))
            keyboard.add(callback_button1)
        elif len(p.targets) < len(utils.get_other_team(p).actors):
            callback_button1 = types.InlineKeyboardButton(
                text="Удар", callback_data=str('attack' + str(fight.round)))
            keyboard.add(callback_button1)
            callback_button1 = types.InlineKeyboardButton(
                text="Подойти", callback_data=str('move' + str(fight.round)))
            keyboard.add(callback_button1)
        else:
            callback_button1 = types.InlineKeyboardButton(
                text="Удар", callback_data=str('attack' + str(fight.round)))
            keyboard.add(callback_button1)
    else:
        if not p.weapon.Melee:
            callback_button2 = types.InlineKeyboardButton(
                text="Перезарядка",
                callback_data=str('reload' + str(fight.round)))
            keyboard.add(callback_button2)
        else:
            callback_button2 = types.InlineKeyboardButton(
                text="Отдышаться",
                callback_data=str('reload' + str(fight.round)))

            keyboard.add(callback_button2)

    if p.dodgecd > 0:
        keyboard.add(
            types.InlineKeyboardButton(text='Инфо', callback_data=str('info')))
    else:
        keyboard.add(
            types.InlineKeyboardButton(text='Перекат',
                                       callback_data=str('evade' +
                                                         str(fight.round))),
            types.InlineKeyboardButton(text='Инфо', callback_data=str('info')))

    if not p.Armed:
        if len(p.itemlist) > 2:
            callback_button1 = types.InlineKeyboardButton(
                text="Дополнительно",
                callback_data=str('inventory' + str(fight.round)))
            keyboard.add(callback_button1)
        else:
            for c in p.itemlist:
                if p.energy >= 2:
                    keyboard.add(
                        types.InlineKeyboardButton(
                            text=c.name,
                            callback_data=str(c.id + str(fight.round))))
                elif c.energy is False:
                    keyboard.add(
                        types.InlineKeyboardButton(
                            text=c.name,
                            callback_data=str(c.id + str(fight.round))))

    else:
        callback_button1 = types.InlineKeyboardButton(
            text="Отменить", callback_data=str('release' + str(fight.round)))
        keyboard.add(callback_button1)
    if p.lostweapon is not None:
        keyboard.add(
            types.InlineKeyboardButton(text='Подобрать оружие',
                                       callback_data=str('take' +
                                                         str(fight.round))))
    if p.firecounter > 0:
        keyboard.add(
            types.InlineKeyboardButton(text='Потушиться',
                                       callback_data=str('skip' +
                                                         str(fight.round))))
    else:
        keyboard.add(
            types.InlineKeyboardButton(text='Пропустить',
                                       callback_data=str('skip' +
                                                         str(fight.round))))
    p.choicemessage = bot.send_message(p.chat_id,
                                       utils.player_turn_info(p).string,
                                       reply_markup=keyboard)
    p.info.clear()
Exemplo n.º 45
0
def send_action(p, fight):
    keyboard = types.InlineKeyboardMarkup()
    if p.energy > 0:
        if not p.weapon.Melee:
            callback_button1 = types.InlineKeyboardButton(text="O`q uzish", callback_data=str('attack'
                                                                                            + str(fight.round)))
            callback_button2 = types.InlineKeyboardButton(text="Qayta o`qlash", callback_data=str('reload'
                                                                                                + str(fight.round)))
            keyboard.add(callback_button1, callback_button2)
        else:
            if p.Inmelee:
                callback_button1 = types.InlineKeyboardButton(text="Zarb",
                                                              callback_data=str('attack' + str(fight.round)))
                callback_button2 = types.InlineKeyboardButton(text="Dam olish",
                                                              callback_data=str('reload' + str(fight.round)))
                keyboard.add(callback_button1, callback_button2)
            else:
                if not p.targets:
                    callback_button1 = types.InlineKeyboardButton(text="Yaqinlashish",
                                                                  callback_data=str('move' + str(fight.round)))
                    callback_button2 = types.InlineKeyboardButton(text="Dam olish",
                                                                  callback_data=str('reload' + str(fight.round)))
                    keyboard.add(callback_button1, callback_button2)
                elif len(p.targets) < len(utils.get_other_team(p).actors):
                    callback_button1 = types.InlineKeyboardButton(text="Zarb",
                                                                  callback_data=str('attack' + str(fight.round)))
                    callback_button2 = types.InlineKeyboardButton(text="Dam olish",
                                                                  callback_data=str('reload' + str(fight.round)))
                    keyboard.add(callback_button1, callback_button2)
                    callback_button1 = types.InlineKeyboardButton(text="Yaqinlashish",
                                                                  callback_data=str('move' + str(fight.round)))
                    keyboard.add(callback_button1)
                else:
                    callback_button1 = types.InlineKeyboardButton(text="Zarb",
                                                                  callback_data=str('attack' + str(fight.round)))
                    callback_button2 = types.InlineKeyboardButton(text="Dam olish",
                                                                  callback_data=str('reload' + str(fight.round)))
                    keyboard.add(callback_button1, callback_button2)
    elif special_abilities.Zombie in p.abilities:
        if not p.targets:
            callback_button1 = types.InlineKeyboardButton(text="Yaqinlashish",
                                                          callback_data=str('move' + str(fight.round)))
            keyboard.add(callback_button1)
        elif len(p.targets) < len(utils.get_other_team(p).actors):
            callback_button1 = types.InlineKeyboardButton(text="Zarb",
                                                          callback_data=str('attack' + str(fight.round)))
            keyboard.add(callback_button1)
            callback_button1 = types.InlineKeyboardButton(text="Yaqinlashish",
                                                          callback_data=str('move' + str(fight.round)))
            keyboard.add(callback_button1)
        else:
            callback_button1 = types.InlineKeyboardButton(text="Zarb",
                                                          callback_data=str('attack' + str(fight.round)))
            keyboard.add(callback_button1)
    else:
        if not p.weapon.Melee:
            callback_button2 = types.InlineKeyboardButton(text="Qayta o`qlash",
                                                          callback_data=str('reload' + str(fight.round)))
            keyboard.add(callback_button2)
        else:
            callback_button2 = types.InlineKeyboardButton(text="Dam olish",
                                                          callback_data=str('reload' + str(fight.round)))

            keyboard.add(callback_button2)

    if p.dodgecd > 0:
        keyboard.add(types.InlineKeyboardButton(text='Info', callback_data=str('info')))
    else:
        keyboard.add(types.InlineKeyboardButton(text='Chetlashish', callback_data=str('evade' + str(fight.round))),
                     types.InlineKeyboardButton(text='Info', callback_data=str('info')))

    if not p.Armed:
        if len(p.itemlist) > 2:
            callback_button1 = types.InlineKeyboardButton(text="Qo`shimcha",
                                                          callback_data=str('inventory' + str(fight.round)))
            keyboard.add(callback_button1)
        else:
            for c in p.itemlist:
                if p.energy >= 2:
                    keyboard.add(types.InlineKeyboardButton(text=c.name, callback_data=str(c.id + str(fight.round))))
                elif c.energy is False:
                    keyboard.add(types.InlineKeyboardButton(text=c.name, callback_data=str(c.id + str(fight.round))))

    else:
        callback_button1 = types.InlineKeyboardButton(text="Bekor qilish",
                                                      callback_data=str('release' + str(fight.round)))
        keyboard.add(callback_button1)
    if p.lostweapon is not None:
        keyboard.add(types.InlineKeyboardButton(text='Qurolni olish', callback_data=str('take' + str(fight.round))))
    if p.firecounter > 0:
        keyboard.add(types.InlineKeyboardButton(text='O`tni o`chirish', callback_data=str('skip' + str(fight.round))))
    else:
        keyboard.add(types.InlineKeyboardButton(text='O`tkazib yuborish', callback_data=str('skip' + str(fight.round))))
    p.choicemessage = bot.send_message(p.chat_id, utils.player_turn_info(p).string, reply_markup=keyboard)
    p.info.clear()