Fix protection not working against assassin sometimes

This commit is contained in:
skizzerz 2015-07-11 12:16:50 -05:00
parent 130a859458
commit ee2a4ef2cf

View File

@ -3186,7 +3186,9 @@ def transition_day(cli, gameid=0):
# Logic out stacked kills and protections. If we get down to 1 kill remaining that is valid and the victim is in bywolves, # Logic out stacked kills and protections. If we get down to 1 kill remaining that is valid and the victim is in bywolves,
# we re-add them to onlybywolves to indicate that the other kill attempts were guarded against (and the wolf kill is what went through) # we re-add them to onlybywolves to indicate that the other kill attempts were guarded against (and the wolf kill is what went through)
# If protections >= kills, we keep track of which protection message to show (prot totem > GA > bodyguard) # If protections >= kills, we keep track of which protection message to show (prot totem > GA > bodyguard)
for v in victims_set: pl = var.list_players()
for v in pl:
if v in victims_set:
numkills = victims.count(v) numkills = victims.count(v)
numtotems = var.PROTECTED.count(v) numtotems = var.PROTECTED.count(v)
if numtotems >= numkills: if numtotems >= numkills:
@ -3212,6 +3214,17 @@ def transition_day(cli, gameid=0):
numkills -= 1 numkills -= 1
if numkills == 1 and v in bywolves: if numkills == 1 and v in bywolves:
onlybywolves.add(v) onlybywolves.add(v)
else:
# player wasn't targeted, but apply protections on them
numtotems = var.PROTECTED.count(v)
for i in range(0, numtotems):
var.ACTIVE_PROTECTIONS[v].append("totem")
for g in var.ROLES["guardian angel"]:
if var.GUARDED.get(g) == v:
var.ACTIVE_PROTECTIONS[v].append("angel")
for g in var.ROLES["bodyguard"]:
if var.GUARDED.get(g) == v:
var.ACTIVE_PROTECTIONS[v].append("bodyguard")
fallenkills = set() fallenkills = set()
brokentotem = set() brokentotem = set()