Voting fixes for mudkip and succubus
- Remove short-circuit in chk_decision event on day timeout. No idea why I put that there to begin with... - Don't make succubus remove voters from the list, rather just set their weight to 0. This causes their vote to not count while still letting stuff interact with the fact they voted succ (such as desperation totem) - Ensure that mudkip's vote change works on day timeout as well
This commit is contained in:
parent
1989be5c8d
commit
0fa7664526
@ -1339,7 +1339,7 @@ class MudkipMode(GameMode):
|
||||
|
||||
avail = len(evt.params.voters)
|
||||
voted = sum(map(len, evt.data["votelist"].values()))
|
||||
if avail != voted:
|
||||
if avail != voted and not evt.params.timeout:
|
||||
return
|
||||
|
||||
majority = avail // 2 + 1
|
||||
|
@ -229,11 +229,6 @@ def on_chk_decision(evt, cli, var, force):
|
||||
evt.data["weights"][votee][v] = weight
|
||||
evt.data["numvotes"][votee] = numvotes
|
||||
|
||||
@event_listener("chk_decision", priority=1.1)
|
||||
def on_hurry_up(evt, cli, var, force):
|
||||
if evt.params.timeout:
|
||||
evt.stop_processing = True
|
||||
|
||||
@event_listener("chk_decision_abstain")
|
||||
def on_chk_decision_abstain(evt, cli, var, nl):
|
||||
for p in nl:
|
||||
|
@ -101,13 +101,14 @@ def on_get_random_totem_targets(evt, var, shaman):
|
||||
if succubus in evt.data["targets"]:
|
||||
evt.data["targets"].remove(succubus)
|
||||
|
||||
@event_listener("chk_decision", priority=0)
|
||||
@event_listener("chk_decision")
|
||||
def on_chk_decision(evt, cli, var, force):
|
||||
for votee, voters in evt.data["votelist"].items():
|
||||
if users._get(votee) in get_all_players(("succubus",)): # FIXME
|
||||
for vtr in ENTRANCED:
|
||||
if vtr.nick in voters:
|
||||
voters.remove(vtr.nick)
|
||||
evt.data["numvotes"][votee] -= evt.data["weights"][votee][vtr.nick]
|
||||
evt.data["weights"][votee][vtr.nick] = 0
|
||||
|
||||
def _kill_entranced_voters(var, votelist, not_lynching, votee):
|
||||
if not {p.nick for p in get_all_players(("succubus",))} & (set(itertools.chain(*votelist.values())) | not_lynching): # FIXME
|
||||
|
@ -1748,9 +1748,7 @@ def hurry_up(cli, gameid, change):
|
||||
votelist = copy.deepcopy(var.VOTES)
|
||||
|
||||
# Note: this event can be differentiated between regular chk_decision
|
||||
# by checking evt.param.timeout. A priority 1.1 event stops event
|
||||
# propagation, so your priority should be between 1 and 1.1 if you wish
|
||||
# to handle this event
|
||||
# by checking evt.params.timeout.
|
||||
event = Event("chk_decision", {
|
||||
"not_lynching": not_lynching,
|
||||
"votelist": votelist,
|
||||
|
Loading…
x
Reference in New Issue
Block a user