fix players not being removed from var.KILLS when they die, and revert f8574e18928f
This commit is contained in:
parent
250e7d7462
commit
e84e786d39
@ -1623,9 +1623,10 @@ def del_player(cli, nick, forced_death = False, devoice = True, end_game = True,
|
|||||||
if var.PHASE in ("night", "day") and ret:
|
if var.PHASE in ("night", "day") and ret:
|
||||||
# remove the player from variables if they're 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:
|
for n in b: #var.KILLS can have 2 kills in a list
|
||||||
del var.KILLS[a]
|
if n == nick:
|
||||||
elif a == nick:
|
var.KILLS[a].remove(nick)
|
||||||
|
if a == nick or len(var.KILLS[a]) == 0:
|
||||||
del var.KILLS[a]
|
del var.KILLS[a]
|
||||||
for x in (var.OBSERVED, var.HVISITED, var.GUARDED, var.TARGETED, var.LASTGUARDED, var.LASTGIVEN):
|
for x in (var.OBSERVED, var.HVISITED, var.GUARDED, var.TARGETED, var.LASTGUARDED, var.LASTGIVEN):
|
||||||
keys = list(x.keys())
|
keys = list(x.keys())
|
||||||
@ -2512,29 +2513,25 @@ 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")
|
||||||
try:
|
if var.ROLE_REVEAL:
|
||||||
role = var.get_reveal_role(victim)
|
role = var.get_reveal_role(victim)
|
||||||
except KeyError:
|
an = "n" if role[0] in ("a", "e", "i", "o", "u") else ""
|
||||||
pass # Already died somehow
|
message.append(("The dead body of \u0002{0}\u0002, a{1} \u0002{2}\u0002, is found. " +
|
||||||
|
"Those remaining mourn the tragedy.").format(victim, an, role))
|
||||||
else:
|
else:
|
||||||
if var.ROLE_REVEAL:
|
message.append(("The dead body of \u0002{0}\u0002 is found. " +
|
||||||
an = "n" if role[0] in ("a", "e", "i", "o", "u") else ""
|
"Those remaining mourn the tragedy.").format(victim))
|
||||||
message.append(("The dead body of \u0002{0}\u0002, a{1} \u0002{2}\u0002, is found. " +
|
dead.append(victim)
|
||||||
"Those remaining mourn the tragedy.").format(victim, an, role))
|
var.LOGGER.logBare(victim, "KILLED")
|
||||||
else:
|
if random.random() < 1/50:
|
||||||
message.append(("The dead body of \u0002{0}\u0002 is found. " +
|
message.append(random.choice(
|
||||||
"Those remaining mourn the tragedy.").format(victim))
|
["https://i.imgur.com/nO8rZ.gif",
|
||||||
dead.append(victim)
|
"https://i.imgur.com/uGVfZ.gif",
|
||||||
var.LOGGER.logBare(victim, "KILLED")
|
"https://i.imgur.com/mUcM09n.gif",
|
||||||
if random.random() < 1/50:
|
"https://i.imgur.com/P7TEGyQ.gif",
|
||||||
message.append(random.choice(
|
"https://i.imgur.com/b8HAvjL.gif",
|
||||||
["https://i.imgur.com/nO8rZ.gif",
|
"https://i.imgur.com/PIIfL15.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():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user