Change branch condition for checking if night is over, fixes #17

chk_nightdone used to check whether the number of people seen equals
the number of seers (and the same for harlot, etc.). This means night
times out if the seer (etc.) leaves after seeing but before night is
otherwise ended. This commit changes equals to >=, and swaps around the
wolf part of that condition so that it matches the other parts.
This commit is contained in:
Robert Wall 2013-07-15 19:37:10 -07:00
parent 1487256f09
commit ed62cbbfc9

View File

@ -1457,10 +1457,10 @@ def transition_day(cli, gameid=0):
def chk_nightdone(cli):
if (len(var.SEEN) == len(var.ROLES["seer"]) and # Seers have seen.
len(var.HVISITED.keys()) == len(var.ROLES["harlot"]) and # harlots have visited.
len(var.GUARDED.keys()) == len(var.ROLES["guardian angel"]) and # guardians have guarded
len(var.ROLES["werecrow"]+var.ROLES["wolf"]) == len(var.KILLS)+len(var.OBSERVED) and
if (len(var.SEEN) >= len(var.ROLES["seer"]) and # Seers have seen.
len(var.HVISITED.keys()) >= len(var.ROLES["harlot"]) and # harlots have visited.
len(var.GUARDED.keys()) >= len(var.ROLES["guardian angel"]) and # guardians have guarded
len(var.KILLS)+len(var.OBSERVED) >= len(var.ROLES["werecrow"]+var.ROLES["wolf"]) and
var.PHASE == "night"):
# check if wolves are actually agreeing