From 5700ec7d01eb648fd2b0090a217b2db44d56eab7 Mon Sep 17 00:00:00 2001 From: Yizhe Shen Date: Fri, 8 Aug 2014 00:25:58 -0400 Subject: [PATCH] Updated output behaviour for in-game commands available in PM. - Updated behaviour for listroles(), show_votes(), timeleft() - Uses !simple settings when those commands are given in PM - Uses notice if channel is +z and a game is in progress --- modules/wolfgame.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index 03efe19..5bffca2 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -796,10 +796,12 @@ def show_votes(cli, nick, chan, rest): for votee in var.VOTES.keys()] msg = '{}: {}'.format(nick, ', '.join(votelist)) - if chan == nick or nick in pl: - cli.msg(chan, msg) - else: + if chan == nick: + pm(cli, nick, msg) + elif nick not in pl and var.PHASE not in ("none", "join"): cli.notice(nick, msg) + else: + cli.msg(chan, msg) pl = var.list_players() avail = len(pl) - len(var.WOUNDED) @@ -808,10 +810,12 @@ def show_votes(cli, nick, chan, rest): 'required to lynch, \u0002{}\u0002 players available to ' 'vote.').format(nick, len(pl), votesneeded, avail) - if chan == nick or nick in pl: - cli.msg(chan, the_message) - else: + if chan == nick: + pm(cli, nick, the_message) + elif nick not in pl and var.PHASE not in ("none", "join"): cli.notice(nick, the_message) + else: + cli.msg(chan, the_message) @pmcmd('votes') @@ -3020,6 +3024,8 @@ def timeleft(cli, nick, chan, rest): if nick == chan: pm(cli, nick, msg) + elif nick not in var.list_players() and var.PHASE not in ("none", "join"): + cli.notice(nick, msg) else: cli.msg(chan, msg) @@ -3055,6 +3061,8 @@ def listroles(cli, nick, chan, rest): old = v if chan == nick: pm(cli, nick, txt) + elif nick not in var.list_players() and var.PHASE not in ("none", "join"): + cli.notice(nick, txt) else: cli.msg(chan, txt)