Merge branch 'master' of https://github.com/lykoss/lykos
Conflicts: modules/wolfgame.py
This commit is contained in:
commit
4bc9be8454
@ -931,10 +931,12 @@ def show_votes(cli, nick, chan, rest):
|
|||||||
for votee in var.VOTES.keys()]
|
for votee in var.VOTES.keys()]
|
||||||
msg = '{}: {}'.format(nick, ', '.join(votelist))
|
msg = '{}: {}'.format(nick, ', '.join(votelist))
|
||||||
|
|
||||||
if chan == nick or nick in pl:
|
if chan == nick:
|
||||||
cli.msg(chan, msg)
|
pm(cli, nick, msg)
|
||||||
else:
|
elif nick not in pl and var.PHASE not in ("none", "join"):
|
||||||
cli.notice(nick, msg)
|
cli.notice(nick, msg)
|
||||||
|
else:
|
||||||
|
cli.msg(chan, msg)
|
||||||
|
|
||||||
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)
|
||||||
@ -943,10 +945,12 @@ def show_votes(cli, nick, chan, rest):
|
|||||||
'required to lynch, \u0002{}\u0002 players available to '
|
'required to lynch, \u0002{}\u0002 players available to '
|
||||||
'vote.').format(nick, len(pl), votesneeded, avail)
|
'vote.').format(nick, len(pl), votesneeded, avail)
|
||||||
|
|
||||||
if chan == nick or nick in pl:
|
if chan == nick:
|
||||||
cli.msg(chan, the_message)
|
pm(cli, nick, the_message)
|
||||||
else:
|
elif nick not in pl and var.PHASE not in ("none", "join"):
|
||||||
cli.notice(nick, the_message)
|
cli.notice(nick, the_message)
|
||||||
|
else:
|
||||||
|
cli.msg(chan, the_message)
|
||||||
|
|
||||||
|
|
||||||
@pmcmd('votes')
|
@pmcmd('votes')
|
||||||
@ -1688,48 +1692,69 @@ def on_join(cli, raw_nick, chan, acc="*", rname=""):
|
|||||||
if nick == "ChanServ" and not var.OPPED:
|
if nick == "ChanServ" and not var.OPPED:
|
||||||
cli.msg("ChanServ", "op " + chan)
|
cli.msg("ChanServ", "op " + chan)
|
||||||
|
|
||||||
@cmd("goat")
|
|
||||||
|
@cmd('goat')
|
||||||
def goat(cli, nick, chan, rest):
|
def goat(cli, nick, chan, rest):
|
||||||
"""Use a goat to interact with anyone in the channel during the day"""
|
"""Use a goat to interact with anyone in the channel during the day."""
|
||||||
if var.PHASE in ("none", "join"):
|
|
||||||
cli.notice(nick, "No game is currently running.")
|
if var.PHASE in ('none', 'join'):
|
||||||
|
cli.notice(nick, 'No game is currently running.')
|
||||||
return
|
return
|
||||||
elif nick not in var.list_players() or nick in var.DISCONNECTED.keys():
|
elif nick not in var.list_players() or nick in var.DISCONNECTED.keys():
|
||||||
cli.notice(nick, "You're not currently playing.")
|
cli.notice(nick, 'You\'re not currently playing.')
|
||||||
return
|
return
|
||||||
if var.PHASE != "day":
|
|
||||||
cli.notice(nick, "You can only do that in the day.")
|
if var.PHASE != 'day':
|
||||||
|
cli.notice(nick, 'You can only do that in the day.')
|
||||||
return
|
return
|
||||||
if var.GOATED and nick not in var.SPECIAL_ROLES["goat herder"]:
|
|
||||||
cli.notice(nick, "This can only be done once per day.")
|
if var.GOATED and nick not in var.SPECIAL_ROLES['goat herder']:
|
||||||
|
cli.notice(nick, 'This can only be done once per day.')
|
||||||
return
|
return
|
||||||
|
|
||||||
ul = list(var.USERS.keys())
|
ul = list(var.USERS.keys())
|
||||||
ull = [x.lower() for x in ul]
|
ull = [x.lower() for x in ul]
|
||||||
rest = re.split(" +",rest)[0].strip().lower()
|
rest = re.split(' +', rest)[0].strip().lower()
|
||||||
|
|
||||||
if not rest:
|
if not rest:
|
||||||
cli.notice(nick, "Not enough parameters.")
|
cli.notice(nick, 'Not enough parameters.')
|
||||||
return
|
return
|
||||||
|
|
||||||
matches = 0
|
matches = 0
|
||||||
|
|
||||||
for player in ull:
|
for player in ull:
|
||||||
if rest == player:
|
if rest == player:
|
||||||
victim = player
|
victim = player
|
||||||
break
|
break
|
||||||
|
|
||||||
if player.startswith(rest):
|
if player.startswith(rest):
|
||||||
victim = player
|
victim = player
|
||||||
matches += 1
|
matches += 1
|
||||||
else:
|
else:
|
||||||
if matches != 1:
|
if matches != 1:
|
||||||
pm(cli, nick,"\u0002{0}\u0002 is not in this channel.".format(rest))
|
pm(cli, nick, '\x02{}\x02 is not in this channel.'.format(rest))
|
||||||
return
|
return
|
||||||
|
|
||||||
victim = ul[ull.index(victim)]
|
victim = ul[ull.index(victim)]
|
||||||
goatact = random.choice(["kicks", "headbutts"])
|
goatact = random.choice(('kicks', 'headbutts'))
|
||||||
cli.msg(botconfig.CHANNEL, ("\u0002{0}\u0002's goat walks by "+
|
|
||||||
"and {1} \u0002{2}\u0002.").format(nick,
|
cli.msg(chan, '\x02{}\x02\'s goat walks by and {} \x02{}\x02.'.format(
|
||||||
goatact, victim))
|
nick, goatact, victim))
|
||||||
var.LOGGER.logMessage("{0}'s goat walks by and {1} {2}.".format(nick, goatact,
|
|
||||||
victim))
|
var.LOGGER.logMessage('{}\'s goat walks by and {} {}.'.format(
|
||||||
|
nick, goatact, victim))
|
||||||
|
|
||||||
var.GOATED = True
|
var.GOATED = True
|
||||||
|
|
||||||
|
@cmd('fgoat', admin_only=True)
|
||||||
|
def fgoat(cli, nick, chan, rest):
|
||||||
|
goatact = random.choice(['kicks', 'headbutts'])
|
||||||
|
|
||||||
|
cli.msg(chan, '\x02{}\x02\'s goat walks by and {} \x02{}\x02.'.format(
|
||||||
|
nick, goatact, rest))
|
||||||
|
|
||||||
|
var.LOGGER.logMessage('{}\'s goat walks by and {} {}.'.format(
|
||||||
|
nick, goatact, rest))
|
||||||
|
|
||||||
|
|
||||||
@hook("nick")
|
@hook("nick")
|
||||||
@ -5168,6 +5193,8 @@ def timeleft(cli, nick, chan, rest):
|
|||||||
|
|
||||||
if nick == chan:
|
if nick == chan:
|
||||||
pm(cli, nick, msg)
|
pm(cli, nick, msg)
|
||||||
|
elif nick not in var.list_players() and var.PHASE not in ("none", "join"):
|
||||||
|
cli.notice(nick, msg)
|
||||||
else:
|
else:
|
||||||
cli.msg(chan, msg)
|
cli.msg(chan, msg)
|
||||||
|
|
||||||
@ -5206,6 +5233,8 @@ def listroles(cli, nick, chan, rest):
|
|||||||
|
|
||||||
if chan == nick:
|
if chan == nick:
|
||||||
pm(cli, nick, txt)
|
pm(cli, nick, txt)
|
||||||
|
elif nick not in var.list_players() and var.PHASE not in ("none", "join"):
|
||||||
|
cli.notice(nick, txt)
|
||||||
else:
|
else:
|
||||||
cli.msg(chan, txt)
|
cli.msg(chan, txt)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user