Beispiel #1
0
 def special_button(self, target):
     if target is not None:
         return None if not self.special_available(target=target) else \
             keyboards.FightButton('special_button', self.unit,
                                   'wpspecial', str(target), special=self.table_row)
     else:
         return keyboards.FightButton('special_button', self.unit,
                                      'wpspecial', special=self.table_row)
Beispiel #2
0
 def special_button(self, target):
     if target is not None:
         return None if not self.special_available(target=target) else \
             keyboards.FightButton('special_button', self.unit,
                                   'special', str(target), special=self.table_row)
     else:
         ready = self.special_available(target=None)
         cd = self.ready_turn - self.unit.fight.turn if self.cd is not 0 else None
         return keyboards.FightButton('special_button', self.unit,
                                      'special', special=self.table_row, ready=ready, cd=cd)
Beispiel #3
0
 def special_button(self, target):
     return keyboards.FightButton(target.name,
                                  self.unit,
                                  'special',
                                  str(target),
                                  special=self.table_row,
                                  named=True)
Beispiel #4
0
 def options_keyboard(self):
     return [
         keyboards.FightButton(option[0],
                               self.unit,
                               'wpspecial',
                               str(option[1]),
                               named=True) for option in self.options()
     ]
Beispiel #5
0
 def ask_target(self, spell_tuple):
     self.unit.active = True
     string = 'Выберите цель.'
     targets = [*self.unit.targets(), *self.unit.get_allies()]
     buttons = []
     for target in targets:
         buttons.append(
             keyboards.FightButton(
                 (target.name if isinstance(target.name, str) else
                  target.name.str(self.unit.controller.lang)),
                 self.unit,
                 self.types[0],
                 self.name,
                 str(target),
                 spell_tuple,
                 named=True))
     buttons.append(keyboards.MenuButton(self.unit, 'back'))
     keyboard = keyboards.form_keyboard(*buttons)
     self.unit.controller.edit_message(string, reply_markup=keyboard)
Beispiel #6
0
 def create_status_button(self, button_name, lang_tuple):
     button = keyboards.FightButton(lang_tuple, self.unit, 'status-action', self.name, button_name)
     return button
Beispiel #7
0
 def button(self):
     return keyboards.FightButton('name',
                                  self.unit,
                                  'armor',
                                  self.name,
                                  special=self.get_table_row())