From f95abc73039cdb48fdc72c8f82e2b5cbca99a94a Mon Sep 17 00:00:00 2001 From: xnrand Date: Sun, 10 Nov 2013 20:09:08 +0100 Subject: [PATCH] Improvements to the random pictures announcing on kill Added a new picture, you will like this one. Changed that one .jpg URL that actually pointed to a .gif file to .jpg. Changed picking algorithm to have fixed chances even when adding new pictures. Uses random.choice(). We don't want to have these pictures quite as often. We once had a 1/100 chance. To balance things out a bit, a 1/50 chance should do. --- modules/wolfgame.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index 922cab9..c3b99b5 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -1391,16 +1391,14 @@ def transition_day(cli, gameid=0): "tragedy.").format(victim, var.get_role(victim))) dead.append(victim) var.LOGGER.logBare(victim, "KILLED") - wut = random.random() - if wut < 0.01: - # this is pointless. - message.append("https://i.imgur.com/nO8rZ.gif") - elif wut < 0.02: - message.append("https://i.imgur.com/uGVfZ.jpg") - elif wut < 0.03: - message.append("https://i.imgur.com/mUcM09n.gif") - elif wut < 0.04: - message.append("https://i.imgur.com/P7TEGyQ.gif") + if random.random() < 1/50: + message.append(random.choice( + ["https://i.imgur.com/nO8rZ.gif", + "https://i.imgur.com/uGVfZ.gif", + "https://i.imgur.com/mUcM09n.gif", + "https://i.imgur.com/P7TEGyQ.gif", + "https://i.imgur.com/b8HAvjL.gif"] + )) if victim in var.GUNNERS.keys() and var.GUNNERS[victim]: # victim had bullets! if random.random() < var.GUNNER_KILLS_WOLF_AT_NIGHT_CHANCE: