Enhance succubus win message

This commit is contained in:
skizzerz 2015-11-14 19:22:42 -06:00
parent 131a5762ef
commit b351cd496f
3 changed files with 11 additions and 6 deletions

View File

@ -698,6 +698,7 @@
"fquit_fail": "Forcing a live player to leave must be done in channel.",
"join_swap_instead": " Please use '{0}swap' to join instead.",
"demoniac_win": "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.",
"succubus_win": "Game over! The {0} {1} completely enthralled the village, making them officers in an ever-growing army set on spreading their {2} control and influence throughout the entire world.",
"dullahan_die_totem": "Before dying, \u0002{0}\u0002 snaps a whip made of a human spine at \u0002{1}\u0002; however, {1}'s totem emits a brilliant flash of light, causing the attempt to miss.",
"dullahan_die_angel": "Before dying, \u0002{0}\u0002 snaps a whip made of a human spine at \u0002{1}\u0002; however, a guardian angel was on duty and able to foil the attempt.",
"dullahan_die_bodyguard": "Before dying, \u0002{0}\u0002 snaps a whip made of a human spine at \u0002{1}\u0002; however, \u0002{2}\u0002, a bodyguard, sacrificed their life to protect them.",

View File

@ -379,12 +379,18 @@ def irc_equals(nick1, nick2):
return irc_lower(nick1) == irc_lower(nick2)
def plural(role, count=2):
# TODO: use the "inflect" pip package, pass part-of-speech as a kwarg
if count == 1:
return role
bits = role.split()
bits[-1] = {"person": "people",
"wolf": "wolves",
"succubus": "succubi"}.get(bits[-1], bits[-1] + "s")
if bits[-1][-2:] == "'s":
bits[-1] = plural(bits[-1][:-2], count)
bits[-1] += "'" if bits[-1][-1] == "s" else "'s"
else:
bits[-1] = {"person": "people",
"wolf": "wolves",
"has": "have",
"succubus": "succubi"}.get(bits[-1], bits[-1] + "s")
return " ".join(bits)
def list_players(roles = None):

View File

@ -2650,9 +2650,7 @@ def chk_win_conditions(lpl, lwolves, lcubs, lrealwolves, lmonsters, ldemoniacs,
winner = "none"
elif var.PHASE == "day" and lpl - lsuccubi == lentranced:
winner = "succubi"
message = ("Game over! The succub{0} ha{1} won! The succub{0} then take{2} all of the "
"entranced players with them, and go{3} out of the village, never to return"
"...").format(*(("us", "s", "s", "es") if lsuccubi == 1 else ("i", "ve", "", "")))
message = messages["succubus_win"].format(var.plural("succubus", lsuccubi), var.plural("has", lsuccubi), var.plural("master's", lsuccubi))
elif var.PHASE == "day" and lpipers and len(var.list_players()) - lpipers == len(var.CHARMED - var.ROLES["piper"]):
winner = "pipers"
message = messages["piper_win"].format("s" if lpipers > 1 else "", "s" if lpipers == 1 else "")