Add jester role

Similar to fool, the jester wins if they are lynched. Unlike fool,
the game continues if jester is lynched and they win alongside the
normal winners.

Also change it so that a fool's lover does NOT win with fool, so
that fool/jester win mechanics are similar (since jester's lover
would die with jester). It doesn't pay to fall in love with fools!
This commit is contained in:
skizzerz 2014-08-02 22:27:10 -05:00
parent a8e1f84412
commit 137a4f2d03
2 changed files with 22 additions and 14 deletions

View File

@ -810,7 +810,7 @@ def chk_decision(cli, force = ""):
return
# roles that eliminate other players upon being lynched
# note that lovers, assassin, clone, and vengeful ghost are handled in del_player() since they trigger on more than just lynch
elif votee in var.DESPERATE:
if votee in var.DESPERATE:
# Also kill the very last person to vote them, unless they voted themselves last in which case nobody else dies
target = voters[-1]
if target != votee:
@ -898,6 +898,9 @@ def chk_decision(cli, force = ""):
var.LOGGER.logMessage(tmsg.replace("\02", ""))
var.LOGGER.logBare(votee, "MAD SCIENTIST")
cli.msg(botconfig.CHANNEL, tmsg)
# Other
if votee in var.ROLES["jester"]:
var.JESTERS.append(votee)
if var.ROLE_REVEAL:
lmsg = random.choice(var.LYNCH_MESSAGES).format(votee, var.get_reveal_role(votee))
@ -1113,7 +1116,6 @@ def stop_game(cli, winner = ""):
iwon = True
elif rol == "monster" and splr in survived and winner == "monsters":
iwon = True
# del_player() doesn't get called on lynched fool, so both will survive even in that case
elif splr in var.LOVERS and splr in survived:
for lvr in var.LOVERS[splr]:
if lvr in plrl:
@ -1123,13 +1125,7 @@ def stop_game(cli, winner = ""):
if lvrrol == "clone" and lvr in var.FINAL_ROLES:
lvrrol = var.FINAL_ROLES[lvr]
if lvr in survived and not winner.startswith("@") and winner != "monsters":
iwon = True
break
elif lvr in survived and winner.startswith("@") and winner == "@" + lvr:
iwon = True
break
elif lvr in survived and winner == "monsters" and lvrrol == "monster":
if lvr in survived and winner == "monsters" and lvrrol == "monster":
iwon = True
break
if rol == "crazed shaman" or rol == "clone":
@ -1155,6 +1151,8 @@ def stop_game(cli, winner = ""):
won = False
if not iwon:
iwon = won and splr in survived
elif rol == "jester" and splr in var.JESTERS:
iwon = True
elif not iwon:
iwon = won and splr in survived # survived, team won = individual win
@ -3773,6 +3771,13 @@ def transition_night(cli):
else:
cli.notice(fool, "You are a \u0002fool\u0002.")
for jester in var.ROLES["jester"]:
if jester in var.PLAYERS and var.PLAYERS[jester]["cloak"] not in var.SIMPLE_NOTIFY:
cli.msg(jester, ('You are a \u0002jester\u0002. You will win alongside the normal winners ' +
'if you are lynched during the day. You cannot otherwise win this game.'))
else:
cli.notice(jester, "You are a \u0002jester\u0002.")
for monster in var.ROLES["monster"]:
if monster in var.PLAYERS and var.PLAYERS[monster]["cloak"] not in var.SIMPLE_NOTIFY:
cli.msg(monster, ('You are a \u0002monster\u0002. You cannot be killed by the wolves. ' +
@ -4057,6 +4062,7 @@ def start(cli, nick, chann_, rest):
var.ASLEEP = []
var.PROTECTED = []
var.DYING = []
var.JESTERS = []
var.NIGHT_COUNT = 0
var.DAY_COUNT = 0
var.ANGRY_WOLVES = False

View File

@ -114,6 +114,7 @@ ROLE_GUIDE = {# village roles
"clone" : ( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ),
"crazed shaman" : ( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ),
"fool" : ( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ),
"jester" : ( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ),
"monster" : ( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ),
# templates
"cursed villager" : ( 0 , 1 , 1 , 1 , 1 , 1 , 1 , 2 , 2 ),
@ -134,14 +135,14 @@ WOLFCHAT_ROLES = ["wolf", "traitor", "werecrow", "hag", "wolf cub", "sorcerer"]
# Wins with the wolves, even if the roles are not necessarily wolves themselves
WOLFTEAM_ROLES = ["wolf", "traitor", "werecrow", "hag", "wolf cub", "sorcerer", "minion", "cultist"]
# These roles never win as a team, only ever individually (either instead of or in addition to the regular winners)
TRUE_NEUTRAL_ROLES = ["vengeful ghost", "crazed shaman", "fool", "monster", "clone"]
TRUE_NEUTRAL_ROLES = ["vengeful ghost", "crazed shaman", "fool", "jester", "monster", "clone"]
# The roles in here are considered templates and will be applied on TOP of other roles. The restrictions are a list of roles that they CANNOT be applied to
# NB: if you want a template to apply to everyone, list it here but make the restrictions an empty list. Templates not listed here are considered full roles instead
TEMPLATE_RESTRICTIONS = {"cursed villager" : ["wolf", "wolf cub", "werecrow", "seer", "oracle", "augur", "fool"],
"gunner" : ["wolf", "traitor", "werecrow", "hag", "wolf cub", "sorcerer", "minion", "cultist", "fool", "lycan"],
"sharpshooter" : ["wolf", "traitor", "werecrow", "hag", "wolf cub", "sorcerer", "minion", "cultist", "fool", "lycan"],
"mayor" : ["fool"],
TEMPLATE_RESTRICTIONS = {"cursed villager" : ["wolf", "wolf cub", "werecrow", "seer", "oracle", "augur", "fool", "jester"],
"gunner" : ["wolf", "traitor", "werecrow", "hag", "wolf cub", "sorcerer", "minion", "cultist", "fool", "lycan", "jester"],
"sharpshooter" : ["wolf", "traitor", "werecrow", "hag", "wolf cub", "sorcerer", "minion", "cultist", "fool", "lycan", "jester"],
"mayor" : ["fool", "jester"],
"assassin" : ["seer", "augur", "oracle", "harlot", "detective", "bodyguard", "guardian angel", "village drunk", "hunter", "shaman", "crazed shaman", "fool", "mayor", "wolf", "werecrow", "wolf cub", "traitor", "lycan"],
"amnesiac" : ["villager", "cultist", "wolf", "minion", "matchmaker", "village elder", "time lord", "clone", "mad scientist", "vengeful ghost"],
"bureaucrat" : [],
@ -315,6 +316,7 @@ class EvilVillageMode(object):
"clone" : ( 0 , 0 ),
"crazed shaman" : ( 0 , 0 ),
"fool" : ( 0 , 0 ),
"jester" : ( 0 , 0 ),
"monster" : ( 0 , 0 ),
# templates
"cursed villager" : ( 0 , 0 ),