X-Git-Url: http://gitweb.pimeys.fr/?p=bots%2Fhung.git;a=blobdiff_plain;f=hung.py;h=7b848186bd67cfa2b9d3adc62b031b2f06ed906f;hp=dbeff29e5c60d0736ed6209c62eeaedfd195907d;hb=8847da02712c4e2f56c1ab75a3da4d450513a202;hpb=8429f696faa48f834b5583d3b80bc11809716423 diff --git a/hung.py b/hung.py index dbeff29..7b84818 100755 --- a/hung.py +++ b/hung.py @@ -433,7 +433,7 @@ class Hung(ircbot.SingleServerIRCBot): # On perd une chance self.lives[canal] -= 1 if self.lives[canal] > 0: - serv.privmsg(canal, "Pas de %s. Plus que %s chances…" % (giv_let, self.lives[canal])) + serv.privmsg(canal, "Pas de %s. Plus que %s chance%s…" % (giv_let, self.lives[canal], "s" * (self.lives[canal] > 1))) if self.lives[canal] == 0: serv.privmsg(canal, "Pas de %s." % (giv_let)) self.perd(serv, canal) @@ -512,7 +512,7 @@ class Hung(ircbot.SingleServerIRCBot): def gagne(self, serv, canal, bonus=None, bonusvalue=2): serv.privmsg(canal,"Bravo !") realword = self.reveal_word(serv, canal) - nlettre=float(len(realword.replace("'","").replace("-",""))) + nlettre=float(len([l for l in realword if not l in config.non_guess_chars])) contribs=["%s:%s%%%s"%(pseudo,str(int(100*contrib/nlettre)),("+bonus(%s)"%(bonusvalue))*(bonus==pseudo)) for pseudo,contrib in self.play_status[canal][2].items()] contribs_score={pseudo:int(10*contrib/nlettre) for pseudo,contrib in self.play_status[canal][2].items()} self.add_score(contribs_score)