Improve handling of amnesiac turning.

- Proper a/an use when an amnesiac turns.
- If amnesiac turns into a role with wolfchat access, they are not told
that themselves turned into their role.
- If var.AMNESIAC_NIGHTS is set to 1 (normally shouldn't happen, but
happens now in the "random" game mode), it doesn't tell the amnesiac
they just remembered what they were, as game just began anyway.
This commit is contained in:
Vgr E.Barry 2015-03-07 21:02:22 -05:00
parent 8eef082067
commit a4a6546478

View File

@ -5117,14 +5117,20 @@ def transition_night(cli):
var.ROLES["amnesiac"].remove(amn) var.ROLES["amnesiac"].remove(amn)
var.ROLES[amnrole].append(amn) var.ROLES[amnrole].append(amn)
var.AMNESIACS.append(amn) var.AMNESIACS.append(amn)
if var.FIRST_NIGHT: # we don't need to tell them twice if they remember right away
continue
showrole = amnrole showrole = amnrole
if showrole in ("village elder", "time lord"): if showrole in ("village elder", "time lord"):
showrole = "villager" showrole = "villager"
elif showrole == "vengeful ghost": elif showrole == "vengeful ghost":
showrole = var.DEFAULT_ROLE showrole = var.DEFAULT_ROLE
pm(cli, amn, "Your amnesia clears and you now remember that you are a \u0002{0}\u0002!".format(showrole)) n = ""
if showrole[0] in "aeiou":
n = "n"
pm(cli, amn, "Your amnesia clears and you now remember that you are a{0} \u0002{1}\u0002!".format(n, showrole))
if amnrole in var.WOLFCHAT_ROLES: if amnrole in var.WOLFCHAT_ROLES:
for wolf in var.list_players(var.WOLFCHAT_ROLES): for wolf in var.list_players(var.WOLFCHAT_ROLES):
if wolf != amn: # don't send "Foo is now a wolf!" to 'Foo'
pm(cli, wolf, "\u0002{0}\u0002 is now a \u0002{1}\u0002!".format(amn, showrole)) pm(cli, wolf, "\u0002{0}\u0002 is now a \u0002{1}\u0002!".format(amn, showrole))
debuglog("{0} REMEMBER: {1} as {2}".format(amn, amnrole, showrole)) debuglog("{0} REMEMBER: {1} as {2}".format(amn, amnrole, showrole))