Add option to devoice players during night

This commit is contained in:
Vgr E. Barry 2015-09-02 17:48:58 -04:00
parent 78465c9769
commit d827eae2d8
2 changed files with 14 additions and 1 deletions

View File

@ -58,6 +58,7 @@ IDLE_STASIS_PENALTY = 1
PART_STASIS_PENALTY = 1 PART_STASIS_PENALTY = 1
ACC_STASIS_PENALTY = 1 ACC_STASIS_PENALTY = 1
QUIET_DEAD_PLAYERS = False QUIET_DEAD_PLAYERS = False
DEVOICE_DURING_NIGHT = False
QUIET_MODE = "q" # "q" or "b" QUIET_MODE = "q" # "q" or "b"
QUIET_PREFIX = "" # "" or "~q:" QUIET_PREFIX = "" # "" or "~q:"
# The bot will automatically toggle those modes of people joining # The bot will automatically toggle those modes of people joining

View File

@ -2884,7 +2884,7 @@ def del_player(cli, nick, forced_death = False, devoice = True, end_game = True,
cli.msg(botconfig.CHANNEL, tmsg) cli.msg(botconfig.CHANNEL, tmsg)
debuglog(nick, "(mad scientist) KILL FAIL") debuglog(nick, "(mad scientist) KILL FAIL")
if devoice: if devoice and not var.DEVOICE_DURING_NIGHT:
cmode.append(("-v", nick)) cmode.append(("-v", nick))
if var.PHASE == "join": if var.PHASE == "join":
if nick in var.GAMEMODE_VOTES: if nick in var.GAMEMODE_VOTES:
@ -3579,6 +3579,12 @@ def begin_day(cli):
t2.daemon = True t2.daemon = True
t2.start() t2.start()
if var.DEVOICE_DURING_NIGHT:
modes = []
for player in var.list_players():
modes.append(("+v", player))
mass_mode(cli, modes, [])
def night_warn(cli, gameid): def night_warn(cli, gameid):
if gameid != var.NIGHT_ID: if gameid != var.NIGHT_ID:
return return
@ -5903,6 +5909,12 @@ def transition_night(cli):
var.PHASE = "night" var.PHASE = "night"
var.GAMEPHASE = "night" var.GAMEPHASE = "night"
if var.DEVOICE_DURING_NIGHT:
modes = []
for player in var.list_players():
modes.append(("-v", player))
mass_mode(cli, modes, [])
for x, tmr in var.TIMERS.items(): # cancel daytime timer for x, tmr in var.TIMERS.items(): # cancel daytime timer
tmr[0].cancel() tmr[0].cancel()
var.TIMERS = {} var.TIMERS = {}