Revert 180f64e and followup 5e0e022.
This needs proper discussion before being implemented, and if decided to be implemented should be done as a PR. The "don't show person's nick in pmcommand" part is fine and could be re-added, git revert is stupid and doesn't let me do a partial revert.
This commit is contained in:
parent
f592af1d6b
commit
6a0dd3a70c
@ -1315,34 +1315,13 @@ def stats(cli, nick, chan, rest):
|
||||
|
||||
var.LAST_STATS = datetime.now()
|
||||
|
||||
_nick = nick + ": "
|
||||
if nick == chan:
|
||||
_nick = ""
|
||||
|
||||
if chan == nick and nick in pl and var.get_role(nick) in var.WOLFCHAT_ROLES:
|
||||
ps = pl[:]
|
||||
random.shuffle(ps)
|
||||
for i, player in enumerate(ps):
|
||||
prole = var.get_role(player)
|
||||
if prole in var.WOLFCHAT_ROLES:
|
||||
cursed = ""
|
||||
if player in var.ROLES["cursed villager"]:
|
||||
cursed = "cursed "
|
||||
ps[i] = "\u0002{0}\u0002 ({1}{2})".format(player, cursed, prole)
|
||||
elif player in var.ROLES["cursed villager"]:
|
||||
ps[i] = player + " (cursed)"
|
||||
msg = '\u0002{0}\u0002 players: {1}'.format(len(pl), ", ".join(ps))
|
||||
|
||||
elif len(pl) > 1:
|
||||
msg = '{0}\u0002{1}\u0002 players: {2}'.format(_nick,
|
||||
if len(pl) > 1:
|
||||
msg = '{0}: \u0002{1}\u0002 players: {2}'.format(nick,
|
||||
len(pl), ", ".join(pl))
|
||||
else:
|
||||
msg = '{0}\u00021\u0002 player: {1}'.format(_nick, pl[0])
|
||||
msg = '{0}: \u00021\u0002 player: {1}'.format(nick, pl[0])
|
||||
|
||||
if nick == chan:
|
||||
if nick in pl and var.get_role(nick) in var.WOLFCHAT_ROLES:
|
||||
wolfchat(cli, None, msg)
|
||||
else:
|
||||
pm(cli, nick, msg)
|
||||
else:
|
||||
if nick in pl or var.PHASE == "join":
|
||||
@ -1444,15 +1423,12 @@ def stats(cli, nick, chan, rest):
|
||||
message.append("\u0002{0}\u0002 {1}".format(count if count else "\u0002no\u0002", var.plural(role)))
|
||||
else:
|
||||
message.append("\u0002{0}\u0002 {1}".format(count, role))
|
||||
stats_mssg = "{0}It is currently {4}. There {3} {1}, and {2}.".format(_nick,
|
||||
stats_mssg = "{0}: It is currently {4}. There {3} {1}, and {2}.".format(nick,
|
||||
", ".join(message[0:-1]),
|
||||
message[-1],
|
||||
vb,
|
||||
var.PHASE)
|
||||
if nick == chan:
|
||||
if nick in pl and var.get_role(nick) in var.WOLFCHAT_ROLES:
|
||||
wolfchat(cli, None, stats_mssg)
|
||||
else:
|
||||
pm(cli, nick, stats_mssg)
|
||||
else:
|
||||
if nick in pl or var.PHASE == "join":
|
||||
@ -1686,15 +1662,11 @@ def show_votes(cli, nick, chan, rest):
|
||||
|
||||
pl = var.list_players()
|
||||
|
||||
_nick = nick + ": "
|
||||
if chan == nick:
|
||||
_nick = ""
|
||||
|
||||
if chan != nick and nick in pl:
|
||||
var.LAST_VOTES = datetime.now()
|
||||
|
||||
if not var.VOTES.values():
|
||||
msg = _nick + 'No votes yet.'
|
||||
msg = nick+ ': No votes yet.'
|
||||
|
||||
if nick in pl:
|
||||
var.LAST_VOTES = None # reset
|
||||
@ -1703,12 +1675,9 @@ def show_votes(cli, nick, chan, rest):
|
||||
len(var.VOTES[votee]),
|
||||
' '.join(var.VOTES[votee]))
|
||||
for votee in var.VOTES.keys()]
|
||||
msg = '{}{}'.format(_nick, ', '.join(votelist))
|
||||
msg = '{}: {}'.format(nick, ', '.join(votelist))
|
||||
|
||||
if chan == nick:
|
||||
if nick in pl and var.get_role(nick) in var.WOLFCHAT_ROLES:
|
||||
wolfchat(cli, None, msg)
|
||||
else:
|
||||
pm(cli, nick, msg)
|
||||
elif nick not in pl and var.PHASE not in ("none", "join"):
|
||||
cli.notice(nick, msg)
|
||||
@ -1723,14 +1692,11 @@ def show_votes(cli, nick, chan, rest):
|
||||
plural = " has"
|
||||
else:
|
||||
plural = "s have"
|
||||
the_message = ('{}\u0002{}\u0002 players, \u0002{}\u0002 votes '
|
||||
the_message = ('{}: \u0002{}\u0002 players, \u0002{}\u0002 votes '
|
||||
'required to lynch, \u0002{}\u0002 players available to '
|
||||
'vote. \u0002{}\u0002 player{} refrained from voting.').format(_nick, len(pl), votesneeded, avail, not_voting, plural)
|
||||
'vote. \u0002{}\u0002 player{} refrained from voting.').format(nick, len(pl), votesneeded, avail, not_voting, plural)
|
||||
|
||||
if chan == nick:
|
||||
if nick in pl and var.get_role(nick) in var.WOLFCHAT_ROLES:
|
||||
wolfchat(cli, None, the_message)
|
||||
else:
|
||||
pm(cli, nick, the_message)
|
||||
elif nick not in pl and var.PHASE not in ("none", "join"):
|
||||
cli.notice(nick, the_message)
|
||||
@ -4968,21 +4934,19 @@ def relay(cli, nick, chan, rest):
|
||||
return
|
||||
if var.PHASE not in ("night", "day"):
|
||||
return
|
||||
if nick in var.list_players() and var.get_role(nick) in var.WOLFCHAT_ROLES:
|
||||
if rest.startswith("\01ACTION"):
|
||||
rest = rest[7:-1]
|
||||
wolfchat(cli, nick, "\02{0}\02{1}".format(nick, rest))
|
||||
else:
|
||||
wolfchat(cli, nick, "\02{0}\02 says: {1}".format(nick, rest))
|
||||
|
||||
def wolfchat(cli, sender, msg):
|
||||
badguys = var.list_players(var.WOLFCHAT_ROLES)
|
||||
if len(badguys) > 1:
|
||||
if sender in badguys:
|
||||
badguys.remove(sender)
|
||||
if nick in badguys:
|
||||
badguys.remove(nick) # remove self from list
|
||||
|
||||
if rest.startswith("\01ACTION"):
|
||||
rest = rest[7:-1]
|
||||
mass_privmsg(cli, [guy for guy in badguys
|
||||
if guy in var.PLAYERS], msg)
|
||||
if guy in var.PLAYERS], "\02{0}\02{1}".format(nick, rest))
|
||||
else:
|
||||
mass_privmsg(cli, [guy for guy in badguys
|
||||
if guy in var.PLAYERS], "\02{0}\02 says: {1}".format(nick, rest))
|
||||
|
||||
def transition_night(cli):
|
||||
if var.PHASE == "night":
|
||||
@ -6562,9 +6526,6 @@ def listroles(cli, nick, chan, rest):
|
||||
old = {}
|
||||
txt = ""
|
||||
index = 0
|
||||
_nick = nick + ": "
|
||||
if chan == nick:
|
||||
_nick = ""
|
||||
pl = len(var.list_players()) + len(var.DEAD)
|
||||
roleindex = var.ROLE_INDEX
|
||||
roleguide = var.ROLE_GUIDE
|
||||
@ -6574,7 +6535,7 @@ def listroles(cli, nick, chan, rest):
|
||||
rest = re.split(" +", rest.strip(), 1)
|
||||
#prepend player count if called without any arguments
|
||||
if not len(rest[0]) and pl > 0:
|
||||
txt += " {0}There {1} \u0002{2}\u0002 playing.".format(_nick, "is" if pl == 1 else "are", pl)
|
||||
txt += " {0}: There {1} \u0002{2}\u0002 playing.".format(nick, "is" if pl == 1 else "are", pl)
|
||||
if var.PHASE in ["night", "day"]:
|
||||
txt += " Using the {0} game mode.".format(var.CURRENT_GAMEMODE)
|
||||
|
||||
@ -6591,7 +6552,7 @@ def listroles(cli, nick, chan, rest):
|
||||
roleguide = getattr(mode, "ROLE_GUIDE")
|
||||
rest.pop(0)
|
||||
else:
|
||||
txt += " {0}{1} is not a valid game mode.".format(_nick, rest[0])
|
||||
txt += " {0}: {1} is not a valid game mode.".format(nick, rest[0])
|
||||
rest = []
|
||||
roleindex = {}
|
||||
|
||||
@ -6628,9 +6589,6 @@ def listroles(cli, nick, chan, rest):
|
||||
txt = txt[1:]
|
||||
|
||||
if chan == nick:
|
||||
if nick in var.list_players() and var.get_role(nick) in var.WOLFCHAT_ROLES:
|
||||
wolfchat(cli, None, txt)
|
||||
else:
|
||||
pm(cli, nick, txt)
|
||||
elif nick not in var.list_players() and var.PHASE not in ("none", "join"):
|
||||
cli.notice(nick, txt)
|
||||
|
Loading…
x
Reference in New Issue
Block a user