From d26c621b55a67085eac2d186d6a74a90df7c956f Mon Sep 17 00:00:00 2001 From: skizzerz Date: Mon, 20 Jul 2015 23:06:22 -0500 Subject: [PATCH] Fix win sequencing bug If all wolves are dead and there are the same number of wolfteam as vills (due to sorcerers, hags, etc.), then village should be credited with win. --- src/wolfgame.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/wolfgame.py b/src/wolfgame.py index 27553d2..cfb7bcc 100644 --- a/src/wolfgame.py +++ b/src/wolfgame.py @@ -2394,6 +2394,17 @@ def chk_win(cli, end_game = True, winner = None): message = ("Game over! Everyone has fallen victim to the charms of the " + "piper{0}. The piper{0} lead{1} the villagers away from the village, " + "never to return...").format("s" if lpipers > 1 else "", "s" if lpipers == 1 else "") + elif lrealwolves == 0 and traitors == 0 and cubs == 0: + if monsters > 0: + plural = "s" if monsters > 1 else "" + message = ("Game over! All the wolves are dead! As the villagers start preparing the BBQ, " + + "the monster{0} quickly kill{1} the remaining villagers, " + + "causing the monster{0} to win.").format(plural, "" if plural else "s") + winner = "monsters" + else: + message = ("Game over! All the wolves are dead! The villagers " + + "chop them up, BBQ them, and have a hearty meal.") + winner = "villagers" elif lwolves == lpl / 2: if monsters > 0: plural = "s" if monsters > 1 else "" @@ -2416,17 +2427,6 @@ def chk_win(cli, end_game = True, winner = None): message = ("Game over! There are more wolves than "+ "uninjured villagers. The wolves overpower the villagers and win.") winner = "wolves" - elif lrealwolves == 0 and traitors == 0 and cubs == 0: - if monsters > 0: - plural = "s" if monsters > 1 else "" - message = ("Game over! All the wolves are dead! As the villagers start preparing the BBQ, " + - "the monster{0} quickly kill{1} the remaining villagers, " + - "causing the monster{0} to win.").format(plural, "" if plural else "s") - winner = "monsters" - else: - message = ("Game over! All the wolves are dead! The villagers " + - "chop them up, BBQ them, and have a hearty meal.") - winner = "villagers" elif lrealwolves == 0: chk_traitor(cli) return chk_win(cli, end_game)