block roles

fight-fixes
Bobloy 7 years ago
parent 10cc998cc8
commit bed89bf07b

@ -271,7 +271,7 @@ class Game:
await self.village_channel.send(embed=discord.Embed(title="**The sun sets on the village...**")) await self.village_channel.send(embed=discord.Embed(title="**The sun sets on the village...**"))
await self._notify(5) await self._notify(5)
await asyncio.sleep(30) await asyncio.sleep(5)
await self._at_night_start() await self._at_night_start()
async def _at_night_start(self): # ID 6 async def _at_night_start(self): # ID 6
@ -280,9 +280,9 @@ class Game:
await self._notify(6) await self._notify(6)
await asyncio.sleep(120) # 2 minutes 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 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 asyncio.sleep(30) # .5 minutes
await self._at_night_end() await self._at_night_end()
@ -392,9 +392,10 @@ class Game:
await ctx.send("**Corpses** can't vote...") await ctx.send("**Corpses** can't vote...")
return return
if player.blocked: if player.role.blocked:
await ctx.send("Something is preventing you from doing this...") await ctx.send("Something is preventing you from doing this...")
return return
# Let role do target validation, might be alternate targets # Let role do target validation, might be alternate targets
# I.E. Go on alert? y/n # I.E. Go on alert? y/n
@ -411,6 +412,9 @@ class Game:
Night visit target_id Night visit target_id
Returns a target for role information (i.e. Seer) 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) target = await self.get_night_target(target_id, source)
await self._visit(target, source) await self._visit(target, source)
return target return target
@ -513,13 +517,13 @@ class Game:
else: else:
target = await self.get_night_target(target_id, source) target = await self.get_night_target(target_id, source)
if source is not None: if source is not None:
if source.blocked: if source.role.blocked:
# Do nothing if blocked, blocker handles text # Do nothing if blocked, blocker handles text
return return
if not novisit: if not novisit:
# Arsonist wouldn't visit before killing # Arsonist wouldn't visit before killing
await self._visit(target, source) # Visit before killing await self._visit(target, source) # Visit before killing
if not target.protected: if not target.protected:
target.alive = False target.alive = False

@ -105,7 +105,9 @@ class Seer(Role):
async def _at_night_end(self): async def _at_night_end(self):
target = await self.game.visit(self.see_target) 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": if alignment == "Werewolf":
out = "Your insight reveals this player to be a **Werewolf!**" out = "Your insight reveals this player to be a **Werewolf!**"

@ -25,8 +25,8 @@ class VoteGroup:
(self._at_game_start, 0), # (Action, Priority) (self._at_game_start, 0), # (Action, Priority)
(self._at_day_start, 0), (self._at_day_start, 0),
(self._at_voted, 0), (self._at_voted, 0),
(self._at_kill, 0), (self._at_kill, 1),
(self._at_hang, 0), (self._at_hang, 1),
(self._at_day_end, 0), (self._at_day_end, 0),
(self._at_night_start, 2), (self._at_night_start, 2),
(self._at_night_end, 0), (self._at_night_end, 0),

@ -31,8 +31,8 @@ class WolfVote(VoteGroup):
(self._at_game_start, 0), # (Action, Priority) (self._at_game_start, 0), # (Action, Priority)
(self._at_day_start, 0), (self._at_day_start, 0),
(self._at_voted, 0), (self._at_voted, 0),
(self._at_kill, 0), (self._at_kill, 1),
(self._at_hang, 0), (self._at_hang, 1),
(self._at_day_end, 0), (self._at_day_end, 0),
(self._at_night_start, 2), (self._at_night_start, 2),
(self._at_night_end, 5), # Kill priority (self._at_night_end, 5), # Kill priority
@ -86,14 +86,27 @@ class WolfVote(VoteGroup):
if vote_list: if vote_list:
target_id = max(set(vote_list), key=vote_list.count) 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.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)) await self.channel.send("**{} has left to complete the kill...**".format(self.killer.member.display_name))
else: else:
await self.channel.send("**No kill will be attempted tonight...**") await self.channel.send("**No kill will be attempted tonight...**")
# async def _at_visit(self, data=None): # 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): async def vote(self, target, author, id):
""" """

Loading…
Cancel
Save