diff --git a/lokrez/smashgg.py b/lokrez/smashgg.py index bd0ed05..d1fa658 100644 --- a/lokrez/smashgg.py +++ b/lokrez/smashgg.py @@ -108,9 +108,10 @@ class Player(): # ------------------------------------------------------------------------- def add_character_selection(self, character, win): try: - character = self.CHARACTERS[character] + character = (self.CHARACTERS[character], "00") except KeyError: - pass + if type(character) != tuple: + character = (character, "00") try: self.chars[character] += ( 1.01 if win else 1.00 ) @@ -131,16 +132,12 @@ class Player(): # ------------------------------------------------------------------------- def conf(self): - # The char list looks like 'character1 (12.08), character2 (3.02)' - # where the number between parenthesis is the number of time the - # character was played - charslist = ", ".join( - [ "{} ({:.2f})".format(c,n) for c,n in sorted( - self.chars.items(), - key = lambda cv: cv[1], - reverse = True, - ) ] - ) + # The char list looks like 'character1_skin1 (12.08), character2_skin2 + # (3.02)' where the number between parenthesis is the number of time + # the character was played + charslist = ", ".join( [ "{}_{} ({:.2f})".format(c,s,n) for (c,s),n in + sorted( self.chars.items(), key = lambda cv: cv[1], reverse = + True,) ]) return """ [player {tag}]