Mael and mudkip bugfixes

In mael, when giving wolflist to someone who joined midday, I assumed
that pl was a player list when it was already finessed into a list of
strings.

In mudkip, it is possible for the lynch logic to try to lynch someone
twice due to how chk_decision works (if you're forcing someone and
someone ELSE has a majority vote, who actually gets voted depends on the
order in which the dict keys are iterated over). As a result, ensure
that the only possible choice to lynch is the person we're interested in
lynching.
This commit is contained in:
skizzerz 2017-12-22 12:49:55 -06:00
parent 7d7aa78ce2
commit 7ba8290ece

View File

@ -1269,7 +1269,7 @@ class MaelstromMode(GameMode):
pl[i] = "\u0002{0}\u0002 ({1}{2})".format(player, cursed, prole) pl[i] = "\u0002{0}\u0002 ({1}{2})".format(player, cursed, prole)
elif player in var.ROLES["cursed villager"]: elif player in var.ROLES["cursed villager"]:
pl[i] = player.nick + " (cursed)" pl[i] = player.nick + " (cursed)"
wrapper.pm("Players: " + ", ".join(p.nick for p in pl)) wrapper.pm("Players: " + ", ".join(pl))
def role_attribution(self, evt, cli, var, chk_win_conditions, villagers): def role_attribution(self, evt, cli, var, chk_win_conditions, villagers):
self.chk_win_conditions = chk_win_conditions self.chk_win_conditions = chk_win_conditions
@ -1424,8 +1424,11 @@ class MudkipMode(GameMode):
# of a stalemate, as they could use the extra help (especially in 5p). # of a stalemate, as they could use the extra help (especially in 5p).
if self.recursion_guard: if self.recursion_guard:
# in here, this means we're in a child chk_decision event called from this one # in here, this means we're in a child chk_decision event called from this one
# the only thing we need to do is ensure we don't turn into nighttime prematurely # we need to ensure we don't turn into nighttime prematurely or try to vote
# anyone other than the person we're forcing the lynch on
evt.data["transition_night"] = lambda cli: None evt.data["transition_night"] = lambda cli: None
evt.data["votelist"] = {force: set()}
evt.data["numvotes"] = {force: 0}
return return
avail = len(evt.params.voters) avail = len(evt.params.voters)
@ -1454,6 +1457,10 @@ class MudkipMode(GameMode):
if var.GAME_ID == gameid: if var.GAME_ID == gameid:
evt.data["transition_night"](cli) evt.data["transition_night"](cli)
# make original chk_decision that called us no-op
evt.data["votelist"] = {}
evt.data["numvotes"] = {}
def daylight_warning(self, evt, var): def daylight_warning(self, evt, var):
evt.data["message"] = "daylight_warning_killtie" evt.data["message"] = "daylight_warning_killtie"