Fix error when wolves' target dies before sunrise

This commit is contained in:
nyuszika7h 2014-09-03 16:52:08 +02:00
parent ebc806fd25
commit f8574e1892

View File

@ -2500,25 +2500,29 @@ def transition_day(cli, gameid=0):
message.append(("\u0002{0}\u0002's totem emitted a brilliant flash of light last night. " + message.append(("\u0002{0}\u0002's totem emitted a brilliant flash of light last night. " +
"The dead body of \u0002{1}\u0002 was found at the scene.").format(victim, loser)) "The dead body of \u0002{1}\u0002 was found at the scene.").format(victim, loser))
var.LOGGER.logBare(loser, "RETRIBUTION") var.LOGGER.logBare(loser, "RETRIBUTION")
if var.ROLE_REVEAL: try:
role = var.get_reveal_role(victim) role = var.get_reveal_role(victim)
an = "n" if role[0] in ("a", "e", "i", "o", "u") else "" except KeyError:
message.append(("The dead body of \u0002{0}\u0002, a{1} \u0002{2}\u0002, is found. " + pass # Already died somehow
"Those remaining mourn the tragedy.").format(victim, an, role))
else: else:
message.append(("The dead body of \u0002{0}\u0002 is found. " + if var.ROLE_REVEAL:
"Those remaining mourn the tragedy.").format(victim)) an = "n" if role[0] in ("a", "e", "i", "o", "u") else ""
dead.append(victim) message.append(("The dead body of \u0002{0}\u0002, a{1} \u0002{2}\u0002, is found. " +
var.LOGGER.logBare(victim, "KILLED") "Those remaining mourn the tragedy.").format(victim, an, role))
if random.random() < 1/50: else:
message.append(random.choice( message.append(("The dead body of \u0002{0}\u0002 is found. " +
["https://i.imgur.com/nO8rZ.gif", "Those remaining mourn the tragedy.").format(victim))
"https://i.imgur.com/uGVfZ.gif", dead.append(victim)
"https://i.imgur.com/mUcM09n.gif", var.LOGGER.logBare(victim, "KILLED")
"https://i.imgur.com/P7TEGyQ.gif", if random.random() < 1/50:
"https://i.imgur.com/b8HAvjL.gif", message.append(random.choice(
"https://i.imgur.com/PIIfL15.gif"] ["https://i.imgur.com/nO8rZ.gif",
)) "https://i.imgur.com/uGVfZ.gif",
"https://i.imgur.com/mUcM09n.gif",
"https://i.imgur.com/P7TEGyQ.gif",
"https://i.imgur.com/b8HAvjL.gif",
"https://i.imgur.com/PIIfL15.gif"]
))
if victim in var.HVISITED.values() and victim in bywolves: # victim was visited by some harlot and victim was attacked by wolves if victim in var.HVISITED.values() and victim in bywolves: # victim was visited by some harlot and victim was attacked by wolves
for hlt in var.HVISITED.keys(): for hlt in var.HVISITED.keys():