major update and fix for the function that checks if night is done (all seers, wolves, etc have acted)
This commit is contained in:
parent
b5b85898b2
commit
9ffd8aa58f
4
var.py
4
var.py
@ -8,8 +8,8 @@ DRUNK_SHOTS_MULTIPLIER = 3
|
|||||||
NIGHT_TIME_LIMIT = 90
|
NIGHT_TIME_LIMIT = 90
|
||||||
DAY_TIME_LIMIT = 333
|
DAY_TIME_LIMIT = 333
|
||||||
START_WITH_DAY = False
|
START_WITH_DAY = False
|
||||||
KILL_IDLE_TIME = 300
|
KILL_IDLE_TIME = 0 #300
|
||||||
WARN_IDLE_TIME = 180
|
WARN_IDLE_TIME = 0 #180
|
||||||
GAME_COMMAND_ADMIN_ONLY = True
|
GAME_COMMAND_ADMIN_ONLY = True
|
||||||
|
|
||||||
# HIT MISS SUICIDE
|
# HIT MISS SUICIDE
|
||||||
|
18
wolfgame.py
18
wolfgame.py
@ -817,6 +817,7 @@ def begin_day(cli):
|
|||||||
|
|
||||||
# Reset nighttime variables
|
# Reset nighttime variables
|
||||||
var.VICTIM = "" # nickname of kill victim
|
var.VICTIM = "" # nickname of kill victim
|
||||||
|
var.ACTED_WOLVES = set()
|
||||||
var.GUARDED = ""
|
var.GUARDED = ""
|
||||||
var.KILLER = "" # nickname of who chose the victim
|
var.KILLER = "" # nickname of who chose the victim
|
||||||
var.SEEN = [] # list of seers that have had visions
|
var.SEEN = [] # list of seers that have had visions
|
||||||
@ -863,7 +864,7 @@ def transition_day(cli, gameid=0):
|
|||||||
dead = []
|
dead = []
|
||||||
crowonly = var.ROLES["werecrow"] and not var.ROLES["wolf"]
|
crowonly = var.ROLES["werecrow"] and not var.ROLES["wolf"]
|
||||||
for crow, target in iter(var.OBSERVED.items()):
|
for crow, target in iter(var.OBSERVED.items()):
|
||||||
if target in var.ROLES["harlot"]+var.ROLES["seer"]:
|
if target in list(var.HVISITED.keys())+var.SEEN+list(var.GUARDED.keys()):
|
||||||
cli.msg(crow, ("As the sun rises, you conclude that \u0002{0}\u0002 was not in "+
|
cli.msg(crow, ("As the sun rises, you conclude that \u0002{0}\u0002 was not in "+
|
||||||
"bed at night, and you fly back to your house.").format(target))
|
"bed at night, and you fly back to your house.").format(target))
|
||||||
elif target not in var.ROLES["village drunk"]:
|
elif target not in var.ROLES["village drunk"]:
|
||||||
@ -939,13 +940,11 @@ def transition_day(cli, gameid=0):
|
|||||||
|
|
||||||
|
|
||||||
def chk_nightdone(cli):
|
def chk_nightdone(cli):
|
||||||
if (len(var.SEEN) == len(var.ROLES["seer"]) and # Seers have seen.
|
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.HVISITED.keys()) >= len(var.ROLES["harlot"]) and # harlots have visited.
|
||||||
(var.VICTIM or
|
len(var.GUARDED.keys()) >= len(var.ROLES["guardian angel"]) and # guardians have guarded
|
||||||
(var.ROLES["werecrow"] == 1 and # Wolves have done their stuff
|
len(var.ROLES["werecrow"]+var.ROLES["wolf"]) >= len(var.ACTED_WOLVES) and
|
||||||
not var.ROLES["wolf"] and var.OBSERVED) or
|
var.PHASE == "night"):
|
||||||
(not var.ROLES["wolf"] + var.ROLES["werecrow"])) and
|
|
||||||
var.PHASE == "night"): # no wolves
|
|
||||||
if var.TIMERS[0]:
|
if var.TIMERS[0]:
|
||||||
if var.TIMERS[0].is_alive():
|
if var.TIMERS[0].is_alive():
|
||||||
return
|
return
|
||||||
@ -1127,6 +1126,7 @@ def kill(cli, nick, rest):
|
|||||||
return
|
return
|
||||||
var.VICTIM = pl[pll.index(victim)]
|
var.VICTIM = pl[pll.index(victim)]
|
||||||
cli.msg(nick, "You have selected \u0002{0}\u0002 to be killed".format(var.VICTIM))
|
cli.msg(nick, "You have selected \u0002{0}\u0002 to be killed".format(var.VICTIM))
|
||||||
|
var.ACTED_WOLVES.add(nick)
|
||||||
chk_nightdone(cli)
|
chk_nightdone(cli)
|
||||||
|
|
||||||
|
|
||||||
@ -1199,6 +1199,7 @@ def observe(cli, nick, rest):
|
|||||||
cli.msg(nick, "Flying to another wolf's house is a waste of time.")
|
cli.msg(nick, "Flying to another wolf's house is a waste of time.")
|
||||||
return
|
return
|
||||||
var.OBSERVED[nick] = victim
|
var.OBSERVED[nick] = victim
|
||||||
|
var.ACTED_WOLVES.add(nick)
|
||||||
cli.msg(nick, ("You transform into a large crow and start your flight "+
|
cli.msg(nick, ("You transform into a large crow and start your flight "+
|
||||||
"to \u0002{0}'s\u0002 house. You will return after "+
|
"to \u0002{0}'s\u0002 house. You will return after "+
|
||||||
"collecting your observations when day begins.").format(victim))
|
"collecting your observations when day begins.").format(victim))
|
||||||
@ -1445,6 +1446,7 @@ def transition_night(cli):
|
|||||||
|
|
||||||
# Reset nighttime variables
|
# Reset nighttime variables
|
||||||
var.VICTIM = "" # nickname of kill victim
|
var.VICTIM = "" # nickname of kill victim
|
||||||
|
var.ACTED_WOLVES = set()
|
||||||
var.GUARDED = {} # key = by whom, value = the person that is visited
|
var.GUARDED = {} # key = by whom, value = the person that is visited
|
||||||
var.KILLER = "" # nickname of who chose the victim
|
var.KILLER = "" # nickname of who chose the victim
|
||||||
var.SEEN = [] # list of seers that have had visions
|
var.SEEN = [] # list of seers that have had visions
|
||||||
|
Loading…
Reference in New Issue
Block a user