Add first version of the demoniac role
This commit is contained in:
parent
be051dde70
commit
c80078d7f4
@ -251,9 +251,9 @@ WOLFCHAT_ROLES = WOLF_ROLES | {"traitor", "hag", "sorcerer", "warlock", "doomsay
|
|||||||
# Wins with the wolves, even if the roles are not necessarily wolves themselves
|
# Wins with the wolves, even if the roles are not necessarily wolves themselves
|
||||||
WOLFTEAM_ROLES = WOLFCHAT_ROLES | {"minion", "cultist"}
|
WOLFTEAM_ROLES = WOLFCHAT_ROLES | {"minion", "cultist"}
|
||||||
# These roles either steal away wins or can otherwise win with any team
|
# These roles either steal away wins or can otherwise win with any team
|
||||||
TRUE_NEUTRAL_ROLES = frozenset({"crazed shaman", "fool", "jester", "monster", "clone", "piper", "turncoat", "succubus", "demoniac"})
|
TRUE_NEUTRAL_ROLES = frozenset({"crazed shaman", "fool", "jester", "monster", "demoniac", "clone", "piper", "turncoat", "succubus", "demoniac"})
|
||||||
# These are the roles that will NOT be used for when amnesiac turns, everything else is fair game! (var.DEFAULT_ROLE is also added if not in this set)
|
# These are the roles that will NOT be used for when amnesiac turns, everything else is fair game! (var.DEFAULT_ROLE is also added if not in this set)
|
||||||
AMNESIAC_BLACKLIST = frozenset({"monster", "minion", "matchmaker", "clone", "doctor", "villager", "cultist", "piper"})
|
AMNESIAC_BLACKLIST = frozenset({"monster", "demoniac", "minion", "matchmaker", "clone", "doctor", "villager", "cultist", "piper"})
|
||||||
# These roles are seen as wolf by the seer/oracle
|
# These roles are seen as wolf by the seer/oracle
|
||||||
SEEN_WOLF = WOLF_ROLES | {"monster", "mad scientist", "succubus"}
|
SEEN_WOLF = WOLF_ROLES | {"monster", "mad scientist", "succubus"}
|
||||||
# These are seen as the default role (or villager) when seen by seer (this overrides SEEN_WOLF)
|
# These are seen as the default role (or villager) when seen by seer (this overrides SEEN_WOLF)
|
||||||
|
@ -2458,7 +2458,7 @@ def stop_game(cli, winner = "", abort = False, additional_winners = None):
|
|||||||
if lvr in plrl:
|
if lvr in plrl:
|
||||||
lvrrol = plrl[lvr]
|
lvrrol = plrl[lvr]
|
||||||
|
|
||||||
if not winner.startswith("@") and winner not in ("monsters", "pipers"):
|
if not winner.startswith("@") and winner not in ("monsters", "demoniacs", "pipers"):
|
||||||
iwon = True
|
iwon = True
|
||||||
break
|
break
|
||||||
elif winner.startswith("@") and winner == "@" + lvr and var.LOVER_WINS_WITH_FOOL:
|
elif winner.startswith("@") and winner == "@" + lvr and var.LOVER_WINS_WITH_FOOL:
|
||||||
@ -2467,19 +2467,24 @@ def stop_game(cli, winner = "", abort = False, additional_winners = None):
|
|||||||
elif winner == "monsters" and lvrrol == "monster":
|
elif winner == "monsters" and lvrrol == "monster":
|
||||||
iwon = True
|
iwon = True
|
||||||
break
|
break
|
||||||
|
elif winner == "demoniacs" and lvrrol == "demoniac":
|
||||||
|
iwon = True
|
||||||
|
break
|
||||||
elif winner == "pipers" and lvrrol == "piper":
|
elif winner == "pipers" and lvrrol == "piper":
|
||||||
iwon = True
|
iwon = True
|
||||||
break
|
break
|
||||||
elif rol == "monster" and splr in survived and winner == "monsters":
|
elif rol == "monster" and splr in survived and winner == "monsters":
|
||||||
iwon = True
|
iwon = True
|
||||||
|
elif rol == "demoniac" and splr in survived and winner == "demoniacs":
|
||||||
|
iwon = True
|
||||||
elif rol == "piper" and splr in survived and winner == "pipers":
|
elif rol == "piper" and splr in survived and winner == "pipers":
|
||||||
iwon = True
|
iwon = True
|
||||||
elif rol == "crazed shaman" or rol == "clone":
|
elif rol == "crazed shaman" or rol == "clone":
|
||||||
# For clone, this means they ended game while being clone and not some other role
|
# For clone, this means they ended game while being clone and not some other role
|
||||||
if splr in survived and not winner.startswith("@") and winner not in ("monsters", "pipers"):
|
if splr in survived and not winner.startswith("@") and winner not in ("monsters", "demoniacs", "pipers"):
|
||||||
iwon = True
|
iwon = True
|
||||||
elif rol == "vengeful ghost":
|
elif rol == "vengeful ghost":
|
||||||
if not winner.startswith("@") and winner not in ("monsters", "pipers"):
|
if not winner.startswith("@") and winner not in ("monsters", "demoniacs", "pipers"):
|
||||||
if won and splr in survived:
|
if won and splr in survived:
|
||||||
iwon = True
|
iwon = True
|
||||||
elif splr in var.VENGEFUL_GHOSTS and var.VENGEFUL_GHOSTS[splr] == "villagers" and winner == "wolves":
|
elif splr in var.VENGEFUL_GHOSTS and var.VENGEFUL_GHOSTS[splr] == "villagers" and winner == "wolves":
|
||||||
@ -2571,6 +2576,7 @@ def chk_win(cli, end_game=True, winner=None):
|
|||||||
lcubs = len(var.ROLES.get("wolf cub", ()))
|
lcubs = len(var.ROLES.get("wolf cub", ()))
|
||||||
lrealwolves = len(var.list_players(var.WOLF_ROLES - {"wolf cub"}))
|
lrealwolves = len(var.list_players(var.WOLF_ROLES - {"wolf cub"}))
|
||||||
lmonsters = len(var.ROLES.get("monster", ()))
|
lmonsters = len(var.ROLES.get("monster", ()))
|
||||||
|
ldemoniacs = len(var.ROLES.get("demoniac", ()))
|
||||||
ltraitors = len(var.ROLES.get("traitor", ()))
|
ltraitors = len(var.ROLES.get("traitor", ()))
|
||||||
lpipers = len(var.ROLES.get("piper", ()))
|
lpipers = len(var.ROLES.get("piper", ()))
|
||||||
if var.PHASE == "day":
|
if var.PHASE == "day":
|
||||||
@ -2584,9 +2590,9 @@ def chk_win(cli, end_game=True, winner=None):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return chk_win_conditions(lpl, lwolves, lcubs, lrealwolves, lmonsters, ltraitors, lpipers, cli, end_game, winner)
|
return chk_win_conditions(lpl, lwolves, lcubs, lrealwolves, lmonsters, ldemoniacs, ltraitors, lpipers, cli, end_game, winner)
|
||||||
|
|
||||||
def chk_win_conditions(lpl, lwolves, lcubs, lrealwolves, lmonsters, ltraitors, lpipers, cli, end_game=True, winner=None):
|
def chk_win_conditions(lpl, lwolves, lcubs, lrealwolves, lmonsters, ldemoniacs, ltraitors, lpipers, cli, end_game=True, winner=None):
|
||||||
"""Internal handler for the chk_win function."""
|
"""Internal handler for the chk_win function."""
|
||||||
chan = botconfig.CHANNEL
|
chan = botconfig.CHANNEL
|
||||||
with var.GRAVEYARD_LOCK:
|
with var.GRAVEYARD_LOCK:
|
||||||
@ -2609,6 +2615,12 @@ def chk_win_conditions(lpl, lwolves, lcubs, lrealwolves, lmonsters, ltraitors, l
|
|||||||
"the monster{0} quickly kill{1} the remaining villagers, " +
|
"the monster{0} quickly kill{1} the remaining villagers, " +
|
||||||
"causing the monster{0} to win.").format(plural, "" if plural else "s")
|
"causing the monster{0} to win.").format(plural, "" if plural else "s")
|
||||||
winner = "monsters"
|
winner = "monsters"
|
||||||
|
elif ldemoniacs > 0:
|
||||||
|
plural = "s" if ldemoniacs > 1 else ""
|
||||||
|
message = ("Game over! All the wolves are dead! As the villagers start preparing the BBQ, " +
|
||||||
|
"a sudden flash illuminates the sky. Demonic spirits emerge around the sacrificed wolves " +
|
||||||
|
"and possess all villagers, causing the demoniac{0} to win.").format(plural)
|
||||||
|
winner = "demoniacs"
|
||||||
else:
|
else:
|
||||||
message = ("Game over! All the wolves are dead! The villagers " +
|
message = ("Game over! All the wolves are dead! The villagers " +
|
||||||
"chop them up, BBQ them, and have a hearty meal.")
|
"chop them up, BBQ them, and have a hearty meal.")
|
||||||
@ -2642,7 +2654,7 @@ def chk_win_conditions(lpl, lwolves, lcubs, lrealwolves, lmonsters, ltraitors, l
|
|||||||
lcubs = len(var.ROLES.get("wolf cub", ()))
|
lcubs = len(var.ROLES.get("wolf cub", ()))
|
||||||
lrealwolves = len(var.list_players(var.WOLF_ROLES - {"wolf cub"}))
|
lrealwolves = len(var.list_players(var.WOLF_ROLES - {"wolf cub"}))
|
||||||
ltraitors = len(var.ROLES.get("traitor", ()))
|
ltraitors = len(var.ROLES.get("traitor", ()))
|
||||||
return chk_win_conditions(lpl, lwolves, lcubs, lrealwolves, lmonsters, ltraitors, lpipers, cli, end_game)
|
return chk_win_conditions(lpl, lwolves, lcubs, lrealwolves, lmonsters, ldemoniacs, ltraitors, lpipers, cli, end_game)
|
||||||
|
|
||||||
event = Event("chk_win", {"winner": winner, "message": message, "additional_winners": None})
|
event = Event("chk_win", {"winner": winner, "message": message, "additional_winners": None})
|
||||||
event.dispatch(var, lpl, lwolves, lrealwolves)
|
event.dispatch(var, lpl, lwolves, lrealwolves)
|
||||||
@ -2660,6 +2672,9 @@ def chk_win_conditions(lpl, lwolves, lcubs, lrealwolves, lmonsters, ltraitors, l
|
|||||||
if winner == "monsters":
|
if winner == "monsters":
|
||||||
for plr in var.ROLES["monster"]:
|
for plr in var.ROLES["monster"]:
|
||||||
players.append("{0} ({1})".format(plr, var.get_role(plr)))
|
players.append("{0} ({1})".format(plr, var.get_role(plr)))
|
||||||
|
if winner == "demoniacs":
|
||||||
|
for plr in var.ROLES["demoniac"]:
|
||||||
|
players.append("{0} ({1})".format(plr, var.get_role(plr)))
|
||||||
elif winner == "wolves":
|
elif winner == "wolves":
|
||||||
for plr in var.list_players(var.WOLFTEAM_ROLES):
|
for plr in var.list_players(var.WOLFTEAM_ROLES):
|
||||||
players.append("{0} ({1})".format(plr, var.get_role(plr)))
|
players.append("{0} ({1})".format(plr, var.get_role(plr)))
|
||||||
@ -6942,6 +6957,14 @@ def transition_night(cli):
|
|||||||
else:
|
else:
|
||||||
pm(cli, monster, "You are a \u0002monster\u0002.")
|
pm(cli, monster, "You are a \u0002monster\u0002.")
|
||||||
|
|
||||||
|
for demoniac in var.ROLES["demoniac"]:
|
||||||
|
if demoniac in var.PLAYERS and not is_user_simple(demoniac):
|
||||||
|
pm(cli, demoniac, ('You are a \u0002demoniac\u0002. You win instead of the normal winners '+
|
||||||
|
'if all wolves are killed while you are alive.'))
|
||||||
|
else:
|
||||||
|
pm(cli, demoniac, "You are a \u0002demoniac\u0002.")
|
||||||
|
|
||||||
|
|
||||||
for lycan in var.ROLES["lycan"]:
|
for lycan in var.ROLES["lycan"]:
|
||||||
if lycan in var.PLAYERS and not is_user_simple(lycan):
|
if lycan in var.PLAYERS and not is_user_simple(lycan):
|
||||||
pm(cli, lycan, ('You are a \u0002lycan\u0002. You are currently on the side of the ' +
|
pm(cli, lycan, ('You are a \u0002lycan\u0002. You are currently on the side of the ' +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user