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._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,10 +392,11 @@ 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,7 +517,7 @@ 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

@ -105,6 +105,8 @@ class Seer(Role):
async def _at_night_end(self):
target = await self.game.visit(self.see_target)
alignment = None
if target:
alignment = await target.see_alignment(self.player)
if alignment == "Werewolf":

@ -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),

@ -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,7 +86,7 @@ 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:
@ -95,6 +95,19 @@ class WolfVote(VoteGroup):
# async def _at_visit(self, data=None):
# 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):
"""
Receive vote from game

Loading…
Cancel
Save