Eliminate pronouns (S/He, his/her, etc) from messages

(See: http://code.google.com/p/wolf/issues/detail?id=89)
This commit is contained in:
Melissa Draper 2013-06-02 14:25:01 -07:00 committed by Robert Wall
parent dd32467b89
commit 1a6eb7c35b
2 changed files with 55 additions and 64 deletions

View File

@ -462,10 +462,10 @@ def fleave(cli, nick, chann_, rest):
return return
cli.msg(chan, ("\u0002{0}\u0002 is forcing"+ cli.msg(chan, ("\u0002{0}\u0002 is forcing"+
" \u0002{1}\u0002 to leave.").format(nick, a)) " \u0002{1}\u0002 to leave.").format(nick, a))
cli.msg(chan, "Appears (s)he was a \02{0}\02.".format(var.get_role(a))) cli.msg(chan, "Say goodbye to the \02{0}\02.".format(var.get_role(a)))
if var.PHASE in ("day", "night"): if var.PHASE in ("day", "night"):
var.LOGGER.logMessage("{0} is forcing {1} to leave.".format(nick, a)) var.LOGGER.logMessage("{0} is forcing {1} to leave.".format(nick, a))
var.LOGGER.logMessage("Appears (s)he was a {0}.".format(var.get_role(a))) var.LOGGER.logMessage("Say goodbye to the {0}".format(var.get_role(a)))
del_player(cli, a) del_player(cli, a)
@ -779,7 +779,7 @@ def stop_game(cli, winner = ""):
var.LOGGER.saveToFile() var.LOGGER.saveToFile()
for plr, rol in plrl: for plr, rol in plrl:
#if plr not in var.USERS.keys(): # he died TODO: when a player leaves, count the game as lost for him #if plr not in var.USERS.keys(): # they died TODO: when a player leaves, count the game as lost for them
# if plr in var.DEAD_USERS.keys(): # if plr in var.DEAD_USERS.keys():
# acc = var.DEAD_USERS[plr]["account"] # acc = var.DEAD_USERS[plr]["account"]
# else: # else:
@ -925,7 +925,7 @@ def del_player(cli, nick, forced_death = False, devoice = True):
var.DEAD.append(nick) var.DEAD.append(nick)
ret = not chk_win(cli) ret = not chk_win(cli)
if var.PHASE in ("night", "day") and ret: if var.PHASE in ("night", "day") and ret:
# remove him from variables if he is in there # remove the player from variables if they're in there
for a,b in list(var.KILLS.items()): for a,b in list(var.KILLS.items()):
if b == nick: if b == nick:
del var.KILLS[a] del var.KILLS[a]
@ -942,11 +942,11 @@ def del_player(cli, nick, forced_death = False, devoice = True):
del var.DISCONNECTED[nick] del var.DISCONNECTED[nick]
if var.PHASE == "day" and not forced_death and ret: # didn't die from lynching if var.PHASE == "day" and not forced_death and ret: # didn't die from lynching
if nick in var.VOTES.keys(): if nick in var.VOTES.keys():
del var.VOTES[nick] # Delete other people's votes on him del var.VOTES[nick] # Delete other people's votes on the player
for k in list(var.VOTES.keys()): for k in list(var.VOTES.keys()):
if nick in var.VOTES[k]: if nick in var.VOTES[k]:
var.VOTES[k].remove(nick) var.VOTES[k].remove(nick)
if not var.VOTES[k]: # no more votes on that guy if not var.VOTES[k]: # no more votes on that person
del var.VOTES[k] del var.VOTES[k]
break # can only vote once break # can only vote once
@ -977,20 +977,20 @@ def reaper(cli, gameid):
to_warn.append(nick) to_warn.append(nick)
var.IDLE_WARNED.append(nick) var.IDLE_WARNED.append(nick)
var.LAST_SAID_TIME[nick] = (datetime.now() - var.LAST_SAID_TIME[nick] = (datetime.now() -
timedelta(seconds=var.WARN_IDLE_TIME)) # Give him a chance timedelta(seconds=var.WARN_IDLE_TIME)) # Give them a chance
elif (tdiff > timedelta(seconds=var.KILL_IDLE_TIME) and elif (tdiff > timedelta(seconds=var.KILL_IDLE_TIME) and
nick in var.IDLE_WARNED): nick in var.IDLE_WARNED):
if var.KILL_IDLE_TIME: if var.KILL_IDLE_TIME:
to_kill.append(nick) to_kill.append(nick)
elif (tdiff < timedelta(seconds=var.WARN_IDLE_TIME) and elif (tdiff < timedelta(seconds=var.WARN_IDLE_TIME) and
nick in var.IDLE_WARNED): nick in var.IDLE_WARNED):
var.IDLE_WARNED.remove(nick) # he saved himself from death var.IDLE_WARNED.remove(nick) # player saved himself from death
for nck in to_kill: for nck in to_kill:
if nck not in var.list_players(): if nck not in var.list_players():
continue continue
cli.msg(chan, ("\u0002{0}\u0002 didn't get out of bed "+ cli.msg(chan, ("\u0002{0}\u0002 didn't get out of bed for a very long "+
"for a very long time. S/He is declared dead. Appears "+ "time and has been found dead. The survivors bury "+
"(s)he was a \u0002{1}\u0002.").format(nck, var.get_role(nck))) "the \u0002{1}\u0002's body.").format(nck, var.get_role(nck)))
make_stasis(nck, var.IDLE_STASIS_PENALTY) make_stasis(nck, var.IDLE_STASIS_PENALTY)
if not del_player(cli, nck): if not del_player(cli, nck):
return return
@ -1003,15 +1003,15 @@ def reaper(cli, gameid):
for dcedplayer in list(var.DISCONNECTED.keys()): for dcedplayer in list(var.DISCONNECTED.keys()):
_, timeofdc, what = var.DISCONNECTED[dcedplayer] _, timeofdc, what = var.DISCONNECTED[dcedplayer]
if what == "quit" and (datetime.now() - timeofdc) > timedelta(seconds=var.QUIT_GRACE_TIME): if what == "quit" and (datetime.now() - timeofdc) > timedelta(seconds=var.QUIT_GRACE_TIME):
cli.msg(chan, ("\02{0}\02 died due to a fatal attack by wild animals. Appears (s)he "+ cli.msg(chan, ("\02{0}\02 was mauled by wild animals and has died. It seems that "+
"was a \02{1}\02.").format(dcedplayer, var.get_role(dcedplayer))) "\02{1}\02 meat is tasty.").format(dcedplayer, var.get_role(dcedplayer)))
if var.PHASE != "join": if var.PHASE != "join":
make_stasis(dcedplayer, var.PART_STASIS_PENALTY) make_stasis(dcedplayer, var.PART_STASIS_PENALTY)
if not del_player(cli, dcedplayer, devoice = False): if not del_player(cli, dcedplayer, devoice = False):
return return
elif what == "part" and (datetime.now() - timeofdc) > timedelta(seconds=var.PART_GRACE_TIME): elif what == "part" and (datetime.now() - timeofdc) > timedelta(seconds=var.PART_GRACE_TIME):
cli.msg(chan, ("\02{0}\02 died due to eating poisonous berries. Appears (s)he was "+ cli.msg(chan, ("\02{0}\02, a \02{1}\02, ate some poisonous berries "+
"a \02{1}\02.").format(dcedplayer, var.get_role(dcedplayer))) "and has died.").format(dcedplayer, var.get_role(dcedplayer)))
if var.PHASE != "join": if var.PHASE != "join":
make_stasis(dcedplayer, var.PART_STASIS_PENALTY) make_stasis(dcedplayer, var.PART_STASIS_PENALTY)
if not del_player(cli, dcedplayer, devoice = False): if not del_player(cli, dcedplayer, devoice = False):
@ -1209,29 +1209,25 @@ def leave(cli, what, nick, why=""):
return return
# the player who just quit was in the game # the player who just quit was in the game
killhim = True killplayer = True
if what == "part" and (not var.PART_GRACE_TIME or var.PHASE == "join"): if what == "part" and (not var.PART_GRACE_TIME or var.PHASE == "join"):
msg = ("\02{0}\02 died due to eating poisonous berries. Appears "+ msg = ("\02{0}\02, a \02{1}\02, ate some poisonous berries and has "+
"(s)he was a \02{1}\02.").format(nick, var.get_role(nick)) "died.").format(nick, var.get_role(nick))
elif what == "quit" and (not var.QUIT_GRACE_TIME or var.PHASE == "join"): elif what == "quit" and (not var.QUIT_GRACE_TIME or var.PHASE == "join"):
msg = ("\02{0}\02 died due to a fatal attack by wild animals. Appears "+ msg = ("\02{0}\02 was mauled by wild animals and has died. It seems that "+
"(s)he was a \02{1}\02.").format(nick, var.get_role(nick)) "\02{1}\02 meat is tasty.").format(nick, var.get_role(nick))
elif what != "kick": elif what != "kick":
msg = "\u0002{0}\u0002 has gone missing.".format(nick) msg = "\u0002{0}\u0002 has gone missing.".format(nick)
try: killplayer = False
del var.LAST_SAID_TIME[nick]
except KeyError:
pass
killhim = False
else: else:
msg = ("\02{0}\02 died due to falling off a cliff. Appears "+ msg = ("\02{0}\02 died due to falling off a cliff. The "+
"(s)he was a \02{1}\02.").format(nick, var.get_role(nick)) "\02{1}\02 is lost to the ravine forever.").format(nick, var.get_role(nick))
cli.msg(botconfig.CHANNEL, msg) cli.msg(botconfig.CHANNEL, msg)
var.LOGGER.logMessage(msg.replace("\02", "")) var.LOGGER.logMessage(msg.replace("\02", ""))
if var.PHASE != "join": if var.PHASE != "join":
make_stasis(nick, var.PART_STASIS_PENALTY) make_stasis(nick, var.PART_STASIS_PENALTY)
if killhim: if killplayer:
del_player(cli, nick) del_player(cli, nick)
else: else:
var.DISCONNECTED[nick] = (cloak, datetime.now(), what) var.DISCONNECTED[nick] = (cloak, datetime.now(), what)
@ -1251,11 +1247,8 @@ def leave_game(cli, nick, chan, rest):
if nick not in var.list_players() or nick in var.DISCONNECTED.keys(): # not playing if nick not in var.list_players() or nick in var.DISCONNECTED.keys(): # not playing
cli.notice(nick, "You're not currently playing.") cli.notice(nick, "You're not currently playing.")
return return
cli.msg(botconfig.CHANNEL, ("\02{0}\02 died of an unknown disease. "+ cli.msg(botconfig.CHANNEL, ("\02{0}\02, a \02{1}\02, has died of an unknown disease.").format(nick, var.get_role(nick)))
"S/He was a \02{1}\02.").format(nick, var.get_role(nick))) var.LOGGER.logMessage(("{0}, a {1}, has died of an unknown disease.").format(nick, var.get_role(nick)))
var.LOGGER.logMessage(("{0} died of an unknown disease. "+
"S/He was a {1}.").format(nick, var.get_role(nick)))
if var.PHASE != "join": if var.PHASE != "join":
make_stasis(nick, var.LEAVE_STASIS_PENALTY) make_stasis(nick, var.LEAVE_STASIS_PENALTY)
@ -1378,7 +1371,7 @@ def transition_day(cli, gameid=0):
"all night long, and you fly back to your house.").format(target)) "all night long, and you fly back to your house.").format(target))
if victim in var.GUARDED.values(): if victim in var.GUARDED.values():
message.append(("\u0002{0}\u0002 was attacked by the wolves last night, but luckily, the "+ message.append(("\u0002{0}\u0002 was attacked by the wolves last night, but luckily, the "+
"guardian angel protected him/her.").format(victim)) "guardian angel was on duty.").format(victim))
victim = "" victim = ""
elif not victim: elif not victim:
message.append(random.choice(var.NO_VICTIMS_MESSAGES) + message.append(random.choice(var.NO_VICTIMS_MESSAGES) +
@ -1386,12 +1379,12 @@ def transition_day(cli, gameid=0):
elif victim in var.ROLES["harlot"]: # Attacked harlot, yay no kill elif victim in var.ROLES["harlot"]: # Attacked harlot, yay no kill
if var.HVISITED.get(victim): if var.HVISITED.get(victim):
message.append("The wolves' selected victim was a harlot, "+ message.append("The wolves' selected victim was a harlot, "+
"but s/he wasn't home.") "who was not at home last night.")
if victim and (victim not in var.ROLES["harlot"] or # not a harlot if victim and (victim not in var.ROLES["harlot"] or # not a harlot
not var.HVISITED.get(victim)): # harlot stayed home not var.HVISITED.get(victim)): # harlot stayed home
message.append(("The dead body of \u0002{0}\u0002, a "+ message.append(("The dead body of \u0002{0}\u0002, a "+
"\u0002{1}\u0002, is found. Those remaining mourn his/her "+ "\u0002{1}\u0002, is found. Those remaining mourn the "+
"death.").format(victim, var.get_role(victim))) "tragedy.").format(victim, var.get_role(victim)))
dead.append(victim) dead.append(victim)
var.LOGGER.logBare(victim, "KILLED") var.LOGGER.logBare(victim, "KILLED")
if victim in var.GUNNERS.keys() and var.GUNNERS[victim]: # victim had bullets! if victim in var.GUNNERS.keys() and var.GUNNERS[victim]: # victim had bullets!
@ -1444,7 +1437,7 @@ def transition_day(cli, gameid=0):
guntaker = random.choice(var.ROLES["wolf"] + var.ROLES["werecrow"] guntaker = random.choice(var.ROLES["wolf"] + var.ROLES["werecrow"]
+ var.ROLES["traitor"]) # random looter + var.ROLES["traitor"]) # random looter
numbullets = var.GUNNERS[victim] numbullets = var.GUNNERS[victim]
var.WOLF_GUNNERS[guntaker] = numbullets # transfer bullets to him/her var.WOLF_GUNNERS[guntaker] = numbullets # transfer bullets a wolf
mmsg = ("While searching {2}'s belongings, You found " + mmsg = ("While searching {2}'s belongings, You found " +
"a gun loaded with {0} silver bullet{1}! " + "a gun loaded with {0} silver bullet{1}! " +
"You may only use it during the day. " + "You may only use it during the day. " +
@ -1575,9 +1568,9 @@ def retract(cli, nick, chann_, rest):
var.VOTES[voter].remove(nick) var.VOTES[voter].remove(nick)
if not var.VOTES[voter]: if not var.VOTES[voter]:
del var.VOTES[voter] del var.VOTES[voter]
cli.msg(chan, "\u0002{0}\u0002 retracted his/her vote.".format(nick)) cli.msg(chan, "\u0002{0}\u0002's vote was retracted".format(nick))
var.LOGGER.logBare(voter, "RETRACT", nick) var.LOGGER.logBare(voter, "RETRACT", nick)
var.LOGGER.logMessage("{0} retracted his/her vote.".format(nick)) var.LOGGER.logMessage("{0}'s vote was retracted.".format(nick))
var.LAST_VOTES = None # reset var.LAST_VOTES = None # reset
break break
else: else:
@ -1662,18 +1655,18 @@ def shoot(cli, nick, chann_, rest):
elif random.random() <= var.MANSLAUGHTER_CHANCE: elif random.random() <= var.MANSLAUGHTER_CHANCE:
cli.msg(chan, ("\u0002{0}\u0002 is a not a wolf "+ cli.msg(chan, ("\u0002{0}\u0002 is a not a wolf "+
"but was accidentally fatally injured.").format(victim)) "but was accidentally fatally injured.").format(victim))
cli.msg(chan, "Appears (s)he was a \u0002{0}\u0002.".format(victimrole)) cli.msg(chan, "The village has sacrificed a \u0002{0}\u0002.".format(victimrole))
var.LOGGER.logMessage("{0} is not a wolf but was accidentally fatally injured.".format(victim)) var.LOGGER.logMessage("{0} is not a wolf but was accidentally fatally injured.".format(victim))
var.LOGGER.logMessage("Appears (s)he was a {0}.".format(victimrole)) var.LOGGER.logMessage("The village has sacrificed a {0}.".format(victimrole))
if not del_player(cli, victim): if not del_player(cli, victim):
return return
else: else:
cli.msg(chan, ("\u0002{0}\u0002 is a villager and is injured but "+ cli.msg(chan, ("\u0002{0}\u0002 is a villager and was injured. Luckily "+
"will have a full recovery. S/He will be resting "+ "the injury is minor and will heal after a day of "+
"for the day.").format(victim)) "rest.").format(victim))
var.LOGGER.logMessage(("{0} is a villager and is injured but "+ var.LOGGER.logMessage(("{0} is a villager and was injured. Luckily "+
"will have a full recovery. S/He will be resting "+ "the injury is minor and will heal after a day of "+
"for the day").format(victim)) "rest.").format(victim))
if victim not in var.WOUNDED: if victim not in var.WOUNDED:
var.WOUNDED.append(victim) var.WOUNDED.append(victim)
lcandidates = list(var.VOTES.keys()) lcandidates = list(var.VOTES.keys())
@ -1686,15 +1679,13 @@ def shoot(cli, nick, chann_, rest):
chk_decision(cli) chk_decision(cli)
chk_win(cli) chk_win(cli)
elif rand <= chances[0] + chances[1]: elif rand <= chances[0] + chances[1]:
cli.msg(chan, "\u0002{0}\u0002 is a lousy shooter. S/He missed!".format(nick)) cli.msg(chan, "\u0002{0}\u0002 is a lousy shooter and missed!".format(nick))
var.LOGGER.logMessage("{0} is a lousy shooter. S/He missed!".format(nick)) var.LOGGER.logMessage("{0} is a lousy shooter and missed!".format(nick))
else: else:
cli.msg(chan, ("\u0002{0}\u0002 should clean his/her weapons more often. "+ cli.msg(chan, ("Oh no! \u0002{0}\u0002's gun was poorly maintained and has exploded! "+
"The gun exploded and killed him/her!").format(nick)) "The village mourns a gunner-\u0002{1}\u0002.").format(nick, var.get_role(nick)))
cli.msg(chan, "Appears that (s)he was a \u0002{0}\u0002.".format(var.get_role(nick))) var.LOGGER.logMessage(("Oh no! {0}'s gun was poorly maintained and has exploded! "+
var.LOGGER.logMessage(("{0} should clean his/her weapers more often. "+ "The village mourns a gunner-{1}.").format(nick, var.get_role(nick)))
"The gun exploded and killed him/her!").format(nick))
var.LOGGER.logMessage("Appears that (s)he was a {0}.".format(var.get_role(nick)))
if not del_player(cli, nick): if not del_player(cli, nick):
return # Someone won. return # Someone won.
@ -1898,10 +1889,10 @@ def investigate(cli, nick, rest):
" is a... \u0002{1}\u0002!").format(victim, var.get_role(victim))) " is a... \u0002{1}\u0002!").format(victim, var.get_role(victim)))
var.LOGGER.logBare(victim, "INVESTIGATED", nick) var.LOGGER.logBare(victim, "INVESTIGATED", nick)
if random.random() < var.DETECTIVE_REVEALED_CHANCE: # a 2/5 chance (should be changeable in settings) if random.random() < var.DETECTIVE_REVEALED_CHANCE: # a 2/5 chance (should be changeable in settings)
# Reveal his role! # The detective's identity is compromised!
for badguy in var.ROLES["wolf"] + var.ROLES["werecrow"] + var.ROLES["traitor"]: for badguy in var.ROLES["wolf"] + var.ROLES["werecrow"] + var.ROLES["traitor"]:
pm(cli, badguy, ("\u0002{0}\u0002 accidentally drops a paper. The paper reveals "+ pm(cli, badguy, ("Someone accidentally drops a paper. The paper reveals "+
"that (s)he is the detective!").format(nick)) "that \u0002{0}\u0002 is the detective!").format(nick))
var.LOGGER.logBare(nick, "PAPERDROP") var.LOGGER.logBare(nick, "PAPERDROP")
@ -2219,8 +2210,8 @@ def transition_night(cli):
norm_notify = g in var.PLAYERS and var.PLAYERS[g]["cloak"] not in var.SIMPLE_NOTIFY norm_notify = g in var.PLAYERS and var.PLAYERS[g]["cloak"] not in var.SIMPLE_NOTIFY
if norm_notify: if norm_notify:
gun_msg = ("You hold a gun that shoots special silver bullets. You may only use it "+ gun_msg = ("You hold a gun that shoots special silver bullets. You may only use it "+
"during the day. If you shoot a wolf, (s)he will die instantly, but if you "+ "during the day. Wolves and the crow will die instantly when shot, but "+
"shoot a villager, that villager will likely survive. You get {0}.") "a villager or traitor will likely survive. You get {0}.")
else: else:
gun_msg = ("You have a \02gun\02 with {0}.") gun_msg = ("You have a \02gun\02 with {0}.")
if var.GUNNERS[g] == 1: if var.GUNNERS[g] == 1:

View File

@ -88,9 +88,9 @@ NO_VICTIMS_MESSAGES = ("The body of a young penguin pet is found.",
"Traces of wolf fur are found.") "Traces of wolf fur are found.")
LYNCH_MESSAGES = ("The villagers, after much debate, finally decide on lynching \u0002{0}\u0002, who turned out to be... a \u0002{1}\u0002.", LYNCH_MESSAGES = ("The villagers, after much debate, finally decide on lynching \u0002{0}\u0002, who turned out to be... a \u0002{1}\u0002.",
"Under a lot of noise, the pitchfork-bearing villagers lynch \u0002{0}\u0002, who turned out to be... a \u0002{1}\u0002.", "Under a lot of noise, the pitchfork-bearing villagers lynch \u0002{0}\u0002, who turned out to be... a \u0002{1}\u0002.",
"The mob drags a protesting \u0002{0}\u0002 to the hanging tree. S/He succumbs to the will of the horde, and is hanged. It is discovered (s)he was a \u0002{1}\u0002.", "Despite protests, the mob drags their victim to the hanging tree. \u0002{0}\u0002 succumbs to the will of the horde, and is hanged. The villagers have killed a \u0002{1}\u0002.",
"Resigned to his/her fate, \u0002{0}\u0002 is led to the gallows. After death, it is discovered (s)he was a \u0002{1}\u0002.", "Resigned to the inevitable, \u0002{0}\u0002 is led to the gallows. Once the twitching stops, it is discovered that the village lynched a \u0002{1}\u0002.",
"As s/he is about to be lynched, \u0002{0}\u0002, the \u0002{1}\u0002, throws a grenade at the mob. The grenade explodes early.") "Before the rope is pulled, \u0002{0}\u0002, the \u0002{1}\u0002, throws a grenade at the mob. The grenade explodes early.")
import botconfig import botconfig