Fix desperation totem when day times out. Closes #52
This commit is contained in:
parent
caa2c55b08
commit
a73b891b8d
@ -743,8 +743,7 @@ def hurry_up(cli, gameid, change):
|
|||||||
if maxfound[0] > 0 and not found_dup:
|
if maxfound[0] > 0 and not found_dup:
|
||||||
cli.msg(chan, "The sun sets.")
|
cli.msg(chan, "The sun sets.")
|
||||||
var.LOGGER.logMessage("The sun sets.")
|
var.LOGGER.logMessage("The sun sets.")
|
||||||
var.VOTES[maxfound[1]] = [None] * votesneeded
|
chk_decision(cli, force = maxfound[1]) # Induce a lynch
|
||||||
chk_decision(cli) # Induce a lynch
|
|
||||||
else:
|
else:
|
||||||
cli.msg(chan, ("As the sun sets, the villagers agree to "+
|
cli.msg(chan, ("As the sun sets, the villagers agree to "+
|
||||||
"retire to their beds and wait for morning."))
|
"retire to their beds and wait for morning."))
|
||||||
@ -771,8 +770,8 @@ def fday(cli, nick, chan, rest):
|
|||||||
transition_day(cli)
|
transition_day(cli)
|
||||||
|
|
||||||
|
|
||||||
|
# Specify force = "nick" to force nick to be lynched
|
||||||
def chk_decision(cli):
|
def chk_decision(cli, force = ""):
|
||||||
chan = botconfig.CHANNEL
|
chan = botconfig.CHANNEL
|
||||||
pl = var.list_players()
|
pl = var.list_players()
|
||||||
avail = len(pl) - len(var.WOUNDED) - len(var.ASLEEP)
|
avail = len(pl) - len(var.WOUNDED) - len(var.ASLEEP)
|
||||||
@ -780,7 +779,7 @@ def chk_decision(cli):
|
|||||||
aftermessage = None
|
aftermessage = None
|
||||||
for votee, voters in iter(var.VOTES.items()):
|
for votee, voters in iter(var.VOTES.items()):
|
||||||
numvotes = sum([var.BUREAUCRAT_VOTES if p in var.ROLES["bureaucrat"] else 1 for p in voters])
|
numvotes = sum([var.BUREAUCRAT_VOTES if p in var.ROLES["bureaucrat"] else 1 for p in voters])
|
||||||
if numvotes >= votesneeded:
|
if numvotes >= votesneeded or votee == force:
|
||||||
# roles that prevent any lynch from happening
|
# roles that prevent any lynch from happening
|
||||||
if votee in var.ROLES["mayor"] and votee not in var.REVEALED_MAYORS:
|
if votee in var.ROLES["mayor"] and votee not in var.REVEALED_MAYORS:
|
||||||
lmsg = ("While being dragged to the gallows, \u0002{0}\u0002 reveals that they " +
|
lmsg = ("While being dragged to the gallows, \u0002{0}\u0002 reveals that they " +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user