fix chk_win events in gamemodes.py
This commit is contained in:
parent
69fa7d377f
commit
8f38900a44
@ -198,7 +198,7 @@ class VillagergameMode(GameMode):
|
|||||||
events.remove_listener("transition_day_begin", self.transition_day)
|
events.remove_listener("transition_day_begin", self.transition_day)
|
||||||
events.remove_listener("retribution_kill", self.on_retribution_kill, priority=4)
|
events.remove_listener("retribution_kill", self.on_retribution_kill, priority=4)
|
||||||
|
|
||||||
def chk_win(self, evt, var, lpl, lwolves, lrealwolves):
|
def chk_win(self, evt, cli, var, rolemap, lpl, lwolves, lrealwolves):
|
||||||
# village can only win via unanimous vote on the bot nick
|
# village can only win via unanimous vote on the bot nick
|
||||||
# villagergame_lose should probably explain that mechanic
|
# villagergame_lose should probably explain that mechanic
|
||||||
# Note: not implemented here since that needs to work in default too
|
# Note: not implemented here since that needs to work in default too
|
||||||
@ -352,7 +352,7 @@ class EvilVillageMode(GameMode):
|
|||||||
def teardown(self):
|
def teardown(self):
|
||||||
events.remove_listener("chk_win", self.chk_win)
|
events.remove_listener("chk_win", self.chk_win)
|
||||||
|
|
||||||
def chk_win(self, evt, var, lpl, lwolves, lrealwolves):
|
def chk_win(self, evt, cli, var, rolemap, lpl, lwolves, lrealwolves):
|
||||||
lsafes = len(list_players(["oracle", "seer", "guardian angel", "shaman", "hunter", "villager"]))
|
lsafes = len(list_players(["oracle", "seer", "guardian angel", "shaman", "hunter", "villager"]))
|
||||||
lcultists = len(list_players(["cultist"]))
|
lcultists = len(list_players(["cultist"]))
|
||||||
evt.stop_processing = True
|
evt.stop_processing = True
|
||||||
@ -769,7 +769,7 @@ class GuardianMode(GameMode):
|
|||||||
def teardown(self):
|
def teardown(self):
|
||||||
events.remove_listener("chk_win", self.chk_win)
|
events.remove_listener("chk_win", self.chk_win)
|
||||||
|
|
||||||
def chk_win(self, evt, var, lpl, lwolves, lrealwolves):
|
def chk_win(self, evt, cli, var, rolemap, lpl, lwolves, lrealwolves):
|
||||||
lguardians = len(list_players(["guardian angel", "bodyguard"]))
|
lguardians = len(list_players(["guardian angel", "bodyguard"]))
|
||||||
|
|
||||||
if lpl < 1:
|
if lpl < 1:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user