Fix priest death in sleepy, update alpha messages for doomsayer

This commit is contained in:
skizzerz 2015-10-30 12:19:21 -07:00
parent 7915c56b34
commit 627efab5ec
3 changed files with 42 additions and 37 deletions

View File

@ -4,6 +4,7 @@ import random
import math import math
import src.settings as var import src.settings as var
import src.wolfgame as game # for now; need to split out helper functions into another module
import botconfig import botconfig
from src import events from src import events
@ -798,26 +799,34 @@ class SleepyMode(GameMode):
if death_triggers: if death_triggers:
if nickrole == "priest": if nickrole == "priest":
pl = evt.data["pl"] pl = evt.data["pl"]
seers = [p for p in var.list_players("seer") if p in pl] turn_chance = 3/4
harlots = [p for p in var.list_players("harlot") if p in pl] seers = [p for p in var.list_players("seer") if p in pl and random.random() < turn_chance]
cultists = [p for p in var.list_players("cultist") if p in pl] harlots = [p for p in var.list_players("harlot") if p in pl and random.random() < turn_chance]
cultists = [p for p in var.list_players("cultist") if p in pl and random.random() < turn_chance]
total = sum(map(len, (seers, harlots, cultists))) total = sum(map(len, (seers, harlots, cultists)))
if total > 0: if total > 0:
cli.msg(botconfig.CHANNEL, ("The sky suddenly darkens as a thunderstorm appears from nowhere. The bell on the newly-abandoned church starts ringing " + cli.msg(botconfig.CHANNEL, ("The sky suddenly darkens as a thunderstorm appears from nowhere. The bell on the newly-abandoned church starts ringing " +
"in sinister tones, managing to perform \u0002{0}\u0002 tolls before the building is struck repeatedly by lightning, " "in sinister tones, managing to perform \u0002{0}\u0002 {1} before the building is struck repeatedly by lightning, " +
"setting it alight in a raging inferno...").format(total)) "setting it alight in a raging inferno...").format(total, var.plural("toll", total)))
for seer in seers: for seer in seers:
var.ROLE["seer"].remove(seer) var.ROLE["seer"].remove(seer)
var.ROLE["doomsayer"].add(seer) var.ROLE["doomsayer"].add(seer)
# TODO: message pm(cli, seer, ("You feel something rushing into you and taking control over your mind and body. It causes you to rapidly " +
"start transforming into a werewolf, and you realize your vision powers can now be used to inflict malady " +
"on the unwary. You are now a \u0002doomsayer\u0002."))
game.relay_wolfchat_command(cli, seer, "\u0002{0}\u0002 is now a \u0002doomsayer\u0002.", var.WOLF_ROLES, is_wolf_command=True, is_kill_command=True)
for harlot in harlots: for harlot in harlots:
var.ROLE["harlot"].remove(harlot) var.ROLE["harlot"].remove(harlot)
var.ROLE["succubus"].add(harlot) var.ROLE["succubus"].add(harlot)
# TODO: message pm(cli, harlot, ("You feel something rushing into you and taking control over your mind and body. You are now a " +
"\u0002succubus\u0002. Your job is to entrance the village, bringing them all under your absolute " +
"control."))
for cultist in cultists: for cultist in cultists:
var.ROLE["cultist"].remove(cultist) var.ROLE["cultist"].remove(cultist)
var.ROLE["demoniac"].add(cultist) var.ROLE["demoniac"].add(cultist)
# TODO: message pm(cli, cultist, ("You feel something rushing into you and taking control over your mind and body, showing you your new purpose in life. " +
"There are far greater evils than the wolves lurking in the shadows, and by sacrificing all of the wolves, you can " +
"unleash those evils upon the world. You are now a \u0002demoniac\u0002."))
# NOTE: chk_win is called by del_player, don't need to call it here even though this has a chance of ending game # NOTE: chk_win is called by del_player, don't need to call it here even though this has a chance of ending game
# vim: set expandtab:sw=4:ts=4: # vim: set expandtab:sw=4:ts=4:

View File

@ -436,7 +436,9 @@ def irc_lower(nick):
def irc_equals(nick1, nick2): def irc_equals(nick1, nick2):
return irc_lower(nick1) == irc_lower(nick2) return irc_lower(nick1) == irc_lower(nick2)
def plural(role): def plural(role, count=2):
if count == 1:
return role
bits = role.split() bits = role.split()
bits[-1] = {"person": "people", bits[-1] = {"person": "people",
"wolf": "wolves", "wolf": "wolves",

View File

@ -6224,23 +6224,19 @@ def get_bitten_message(nick):
"happening.") "happening.")
elif role in ("seer", "oracle", "augur"): elif role in ("seer", "oracle", "augur"):
if time_left <= 1: if time_left <= 1:
message = ("You were prepared to see some sort of monstruosity, however this time all you see is a person bed-ridden " + message = ("This time in your vision, you saw your best friend surrounded by wolves. However, instead of dying, they started " +
"and unable to move. You see they are sick, and probably contagious. You see a vote taking place outside, " + "to mutate into a werewolf themselves. Looking on in shock, you start wondering how you can find help, when one of " +
"and you're even part of the crowd... The person in bed looks at the window, and longs to get out with the " + "the wolves turns to you and says to get going before day breaks. Confused, you look down and notice that you too " +
"others. They then turn to look at you, but the vision ends at that very moment. As you look outside, you " + "are a wolf; the shock of the realization waking you with a start.")
"realize it's dawn already...")
elif time_left == 2: elif time_left == 2:
message = ("You had a similar vision tonight, except the person wasn't in pain this time, but seemed to mutate " + message = ("You had another strange vision last night. You saw an old childhood bully walking along the edge of a cliff. " +
"into some sort of monster... You are able to see them a bit more, but suddenly, wolves are all around " + "You follow behind them, and after a while they turn around, noticing you. Their face suddenly becomes devoid " +
"both of you. You try to defend yourself, but the wolves just ignore you, and instead take the poor, " + "of all emotion, and they melancholily walk off the precipice, falling hundreds of feet into the rocky shoal below. " +
"harmless villager with them. You try to run after them, but sunlight pierces your eyes, and the vision " + "A sinister grin forms on your face, and you notice that your teeth are pointer than normal as the vision fades.")
"wears off as day breaks...")
else: else:
message = ("Something felt strange in that vision you had tonight... You could see someone falling in agony to " + message = ("Something felt strange in that vision you had last night. You saw the shadows of a person, bed-ridden " +
"the ground, but as hard as you try, you're unable to remember who it was, and you can't see it once " + "and unable to move. You see they are sick, and probably contagious. They look up, and although you cannot" +
"again, even though the rest of your vision is very clear in your mind. You try not to worry too much " + "recognize the face through the pock marks, they seem to recognize you. They point at you, and the vision ends.")
"about it, but, nevertheless, you still attempt to see that strange vision again, and before you realize " +
"it, the sun rises...")
else: else:
if time_left <= 1: if time_left <= 1:
message = ("You had the same dream again, but this time YOU were the pursuer. You smell fear from your quarry " + message = ("You had the same dream again, but this time YOU were the pursuer. You smell fear from your quarry " +
@ -6937,11 +6933,11 @@ def transition_night(cli):
var.ROLES["assassin"].add(chump) var.ROLES["assassin"].add(chump)
debuglog("{0} ({1}) TURNED FALLEN ANGEL".format(chump, chumprole)) debuglog("{0} ({1}) TURNED FALLEN ANGEL".format(chump, chumprole))
elif chumprole in ("seer", "oracle", "augur"): elif chumprole in ("seer", "oracle", "augur"):
pm(cli, chump, ("As you gaze out your window and prepare for yet another sleepless night, you look back " + pm(cli, chump, ("Reflecting on your visions the previous night, you believe that you have discovered a " +
"on what you remember from the previous nights, and realize it is past the time. The villagers " + "way to make them actually happen! This realization is combined with noting that you " +
"you once vowed to help track the wolves are no longer your friends. Your newly-gained powers " + "seem to have transformed into a werewolf, a fact that doesn't seem to faze you in the " +
"see no limit, and an evil grin is drawn on your face as you walk towards the forest, to rejoin " + "slightest. Your face grins with evil resolve as you head out to the forest, in search of " +
"with your new comrades...")) "the other wolves you were until recently trying so hard to kill."))
newrole = "doomsayer" newrole = "doomsayer"
debuglog("{0} ({1}) TURNED DOOMSAYER".format(chump, chumprole)) debuglog("{0} ({1}) TURNED DOOMSAYER".format(chump, chumprole))
else: else:
@ -6954,10 +6950,7 @@ def transition_night(cli):
var.ROLES[chumprole].remove(chump) var.ROLES[chumprole].remove(chump)
var.ROLES[newrole].add(chump) var.ROLES[newrole].add(chump)
var.FINAL_ROLES[chump] = newrole var.FINAL_ROLES[chump] = newrole
for wolf in var.list_players(var.WOLFCHAT_ROLES): relay_wolfchat_command(cli, chump, "\u0002{0}\u0002 is now a \u0002{1}\u0002!".format(chump, newrole), var.WOLF_ROLES, is_wolf_command=True, is_kill_command=True)
if wolf != chump:
# no need for a/an since newrole is either wolf, fallen angel or doomsayer
pm(cli, wolf, "\u0002{0}\u0002 is now a \u0002{1}\u0002!".format(chump, newrole))
# convert amnesiac # convert amnesiac
if var.NIGHT_COUNT == var.AMNESIAC_NIGHTS: if var.NIGHT_COUNT == var.AMNESIAC_NIGHTS:
@ -6985,10 +6978,11 @@ def transition_night(cli):
if showrole.startswith(("a", "e", "i", "o", "u")): if showrole.startswith(("a", "e", "i", "o", "u")):
n = "n" n = "n"
pm(cli, amn, "Your amnesia clears and you now remember that you are a{0} \u0002{1}\u0002!".format(n, showrole)) 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 in_wolflist(amn, amn)
for wolf in var.list_players(var.WOLFCHAT_ROLES): if amnrole in var.WOLF_ROLES:
if wolf != amn: # don't send "Foo is now a wolf!" to 'Foo' relay_wolfchat_command(cli, amn, "\u0002{0}\u0002 is now a \u0002{1}\u0002!".format(amn, showrole), var.WOLF_ROLES, is_wolf_command=True, is_kill_command=True)
pm(cli, wolf, "\u0002{0}\u0002 is now a \u0002{1}\u0002!".format(amn, showrole)) else:
relay_wolfchat_command(cli, amn, "\u0002{0}\u0002 is now a \u0002{1}\u0002!".format(amn, showrole), var.WOLFCHAT_ROLES)
elif amnrole == "turncoat": elif amnrole == "turncoat":
var.TURNCOATS[amn] = ("none", -1) var.TURNCOATS[amn] = ("none", -1)
debuglog("{0} REMEMBER: {1} as {2}".format(amn, amnrole, showrole)) debuglog("{0} REMEMBER: {1} as {2}".format(amn, amnrole, showrole))