Fix end-of-game message for lycan

Lycans and people with lycanthropy totem now properly show up as wolves
if they turned during the game by removing special-case tracking for
them (var.LYCANS) and opting for the generic role-change tracking
(var.FINAL_ROLES) instead. Also, make it so that wolves don't "turn
into" wolves if they are afflicted with lycanthropy and then
subsequently targeted by wolves (which can happen with luck/misdirection
totem).
This commit is contained in:
skizzerz 2015-04-27 23:13:37 -05:00
parent f7af95405a
commit dc9196237c

View File

@ -2132,15 +2132,6 @@ def stop_game(cli, winner = "", abort = False):
else: else:
won = False won = False
iwon = False iwon = False
elif rol == "lycan" or splr in var.LYCANS:
if splr in var.LYCANS and winner == "wolves":
won = True
elif splr not in var.LYCANS and winner == "villagers":
won = True
else:
won = False
if not iwon:
iwon = won and splr in survived
elif rol == "jester" and splr in var.JESTERS: elif rol == "jester" and splr in var.JESTERS:
iwon = True iwon = True
elif not iwon: elif not iwon:
@ -2984,9 +2975,6 @@ def on_nick(cli, oldnick, nick):
if prefix in var.SHAMANS: if prefix in var.SHAMANS:
var.SHAMANS.remove(prefix) var.SHAMANS.remove(prefix)
var.SHAMANS.append(nick) var.SHAMANS.append(nick)
if prefix in var.LYCANS:
var.LYCANS.remove(prefix)
var.LYCANS.append(nick)
if prefix in var.PASSED: if prefix in var.PASSED:
var.PASSED.remove(prefix) var.PASSED.remove(prefix)
var.PASSED.append(nick) var.PASSED.append(nick)
@ -3603,12 +3591,13 @@ def transition_day(cli, gameid=0):
novictmsg = False novictmsg = False
break break
elif (victim in var.ROLES["lycan"] or victim in var.LYCANTHROPES) and victim in onlybywolves and victim not in var.IMMUNIZED: elif (victim in var.ROLES["lycan"] or victim in var.LYCANTHROPES) and victim in onlybywolves and victim not in var.IMMUNIZED:
vrole = var.get_role(victim)
if vrole not in var.WOLFCHAT_ROLES:
message.append("A chilling howl was heard last night. It appears there is another werewolf in our midst!") message.append("A chilling howl was heard last night. It appears there is another werewolf in our midst!")
pm(cli, victim, 'HOOOOOOOOOWL. You have become... a wolf!') pm(cli, victim, 'HOOOOOOOOOWL. You have become... a wolf!')
vrole = var.get_role(victim)
var.ROLES[vrole].remove(victim) var.ROLES[vrole].remove(victim)
var.ROLES["wolf"].append(victim) var.ROLES["wolf"].append(victim)
var.LYCANS.append(victim) var.FINAL_ROLES[victim] = "wolf"
wolves = var.list_players(var.WOLFCHAT_ROLES) wolves = var.list_players(var.WOLFCHAT_ROLES)
random.shuffle(wolves) random.shuffle(wolves)
wolves.remove(victim) # remove self from list wolves.remove(victim) # remove self from list
@ -6009,7 +5998,6 @@ def start(cli, nick, chan, forced = False, restart = ""):
var.GUARDED = {} var.GUARDED = {}
var.HVISITED = {} var.HVISITED = {}
var.HUNTERS = [] var.HUNTERS = []
var.LYCANS = []
var.VENGEFUL_GHOSTS = {} var.VENGEFUL_GHOSTS = {}
var.CLONED = {} var.CLONED = {}
var.TARGETED = {} var.TARGETED = {}