Esempio n. 1
0
 def pprobability(self, pokemon):
     tables = []
     for category in ('Moves', 'Item', 'Ability'):
         probs = [(thing, '{:.0%}'.format(prob))
                  for thing, prob in
                  sorted(self.rbstats.probability[pokemon][category.lower()].items(),
                         key=lambda i: -i[1])]
         tables.append([[category, '']] + probs)
     return multitabulate(tables)
Esempio n. 2
0
    def show_foe_moves(self, my_active, foe):
        known_rows = [('Known Moves', 'damage')]
        for name, dmg_range in self.describe_known_foe_moves(my_active, foe):
            pct_range = self.format_damage_range(dmg_range, my_active)
            known_rows.append((name, pct_range))

        possible_rows = [('Other Moves', 'p', 'damage')]
        for name, prob, dmg_range in self.describe_possible_foe_moves(my_active, foe):
            pct_range = self.format_damage_range(dmg_range, my_active)
            possible_rows.append((name, '{:.0%}'.format(prob), pct_range))

        log.i('\n' + multitabulate((known_rows, possible_rows)))