diff --git a/werewolf/game.py b/werewolf/game.py index e16607b..0d9743c 100644 --- a/werewolf/game.py +++ b/werewolf/game.py @@ -271,7 +271,7 @@ class Game: await self.village_channel.send(embed=discord.Embed(title="**The sun sets on the village...**")) await self._notify(5) - await asyncio.sleep(30) + await asyncio.sleep(5) await self._at_night_start() async def _at_night_start(self): # ID 6 @@ -280,9 +280,9 @@ class Game: await self._notify(6) await asyncio.sleep(120) # 2 minutes - + await self.village_channel.send(embed=discord.Embed(title="**Two minutes of night remain...**")) await asyncio.sleep(90) # 1.5 minutes - + await self.village_channel.send(embed=discord.Embed(title="**Thirty seconds until sunrise...**")) await asyncio.sleep(30) # .5 minutes await self._at_night_end() @@ -392,9 +392,10 @@ class Game: await ctx.send("**Corpses** can't vote...") return - if player.blocked: + if player.role.blocked: await ctx.send("Something is preventing you from doing this...") return + # Let role do target validation, might be alternate targets # I.E. Go on alert? y/n @@ -411,6 +412,9 @@ class Game: Night visit target_id Returns a target for role information (i.e. Seer) """ + if source.role.blocked: + # Blocker handles text + return target = await self.get_night_target(target_id, source) await self._visit(target, source) return target @@ -513,13 +517,13 @@ class Game: else: target = await self.get_night_target(target_id, source) if source is not None: - if source.blocked: + if source.role.blocked: # Do nothing if blocked, blocker handles text return - if not novisit: - # Arsonist wouldn't visit before killing - await self._visit(target, source) # Visit before killing + if not novisit: + # Arsonist wouldn't visit before killing + await self._visit(target, source) # Visit before killing if not target.protected: target.alive = False diff --git a/werewolf/roles/seer.py b/werewolf/roles/seer.py index 3ea8d76..cca024f 100644 --- a/werewolf/roles/seer.py +++ b/werewolf/roles/seer.py @@ -105,7 +105,9 @@ class Seer(Role): async def _at_night_end(self): target = await self.game.visit(self.see_target) - alignment = await target.see_alignment(self.player) + alignment = None + if target: + alignment = await target.see_alignment(self.player) if alignment == "Werewolf": out = "Your insight reveals this player to be a **Werewolf!**" diff --git a/werewolf/votegroup.py b/werewolf/votegroup.py index 27c4b30..d78cee8 100644 --- a/werewolf/votegroup.py +++ b/werewolf/votegroup.py @@ -25,8 +25,8 @@ class VoteGroup: (self._at_game_start, 0), # (Action, Priority) (self._at_day_start, 0), (self._at_voted, 0), - (self._at_kill, 0), - (self._at_hang, 0), + (self._at_kill, 1), + (self._at_hang, 1), (self._at_day_end, 0), (self._at_night_start, 2), (self._at_night_end, 0), diff --git a/werewolf/votegroups/wolfvote.py b/werewolf/votegroups/wolfvote.py index 49431b3..74c6da8 100644 --- a/werewolf/votegroups/wolfvote.py +++ b/werewolf/votegroups/wolfvote.py @@ -31,8 +31,8 @@ class WolfVote(VoteGroup): (self._at_game_start, 0), # (Action, Priority) (self._at_day_start, 0), (self._at_voted, 0), - (self._at_kill, 0), - (self._at_hang, 0), + (self._at_kill, 1), + (self._at_hang, 1), (self._at_day_end, 0), (self._at_night_start, 2), (self._at_night_end, 5), # Kill priority @@ -86,14 +86,27 @@ class WolfVote(VoteGroup): if vote_list: target_id = max(set(vote_list), key=vote_list.count) - if target_id and self.killer: + if target_id is not None and self.killer: await self.game.kill(target_id, self.killer, random.choice(self.kill_messages)) await self.channel.send("**{} has left to complete the kill...**".format(self.killer.member.display_name)) else: await self.channel.send("**No kill will be attempted tonight...**") # async def _at_visit(self, data=None): - # pass + # pass + + # async def register_players(self, *players): + # """ + # Extend players by passed list + # """ + # self.players.extend(players) + + # async def remove_player(self, player): + # """ + # Remove a player from player list + # """ + # if player.id in self.players: + # self.players.remove(player) async def vote(self, target, author, id): """