Turn wolf cub into wolf if they are the only one left. Closes #16

This commit is contained in:
skizzerz 2014-07-19 17:22:57 -05:00
parent cb55f9129b
commit 28fa4b0913

View File

@ -981,11 +981,29 @@ def show_votes(cli, nick, chan, rest):
def chk_traitor(cli): def chk_traitor(cli):
for tt in var.ROLES["traitor"]: for wc in var.ROLES["wolf cub"]:
var.ROLES["wolf"].append(tt) var.ROLES["wolf"].append(wc)
var.ROLES["traitor"].remove(tt) var.ROLES["wolf cub"].remove(wc)
pm(cli, tt, ('HOOOOOOOOOWL. You have become... a wolf!\n'+ var.LOGGER.logBare(wc, "GROW UP")
'It is up to you to avenge your fallen leaders!')) pm(cli, wc, ('You have grown up into a wolf and vowed to take revenge for your dead parents!'))
if len(var.ROLES["wolf"]) == 0:
for tt in var.ROLES["traitor"]:
var.ROLES["wolf"].append(tt)
var.ROLES["traitor"].remove(tt)
var.LOGGER.logBare(tt, "TRANSFORM")
pm(cli, tt, ('HOOOOOOOOOWL. You have become... a wolf!\n'+
'It is up to you to avenge your fallen leaders!'))
# no message if wolf cub becomes wolf for now, may want to change that in future
if len(var.ROLES["wolf"]) > 0:
if var.ROLE_REVEAL:
cli.msg(botconfig.CHANNEL, ('\u0002The villagers, during their celebrations, are '+
'frightened as they hear a loud howl. The wolves are '+
'not gone!\u0002'))
var.LOGGER.logMessage(('The villagers, during their celebrations, are '+
'frightened as they hear a loud howl. The wolves are '+
'not gone!'))
@ -1214,16 +1232,7 @@ def chk_win(cli, end_game = True):
"chop them up, BBQ them, and have a hearty meal.") "chop them up, BBQ them, and have a hearty meal.")
winner = "villagers" winner = "villagers"
elif lrealwolves == 0: elif lrealwolves == 0:
for t in var.ROLES["traitor"]:
var.LOGGER.logBare(t, "TRANSFORM")
chk_traitor(cli) chk_traitor(cli)
if var.ROLE_REVEAL:
cli.msg(chan, ('\u0002The villagers, during their celebrations, are '+
'frightened as they hear a loud howl. The wolves are '+
'not gone!\u0002'))
var.LOGGER.logMessage(('The villagers, during their celebrations, are '+
'frightened as they hear a loud howl. The wolves are '+
'not gone!'))
return chk_win(cli, end_game) return chk_win(cli, end_game)
else: else:
return False return False