|
|
|
@ -101,7 +101,7 @@ class Game:
|
|
|
|
|
await self._at_game_start() # This will queue channels and votegroups to be made
|
|
|
|
|
print("Post at_game_start")
|
|
|
|
|
for channel_id in self.p_channels:
|
|
|
|
|
print("Channel id: "+channel_id)
|
|
|
|
|
print("Channel id: " + channel_id)
|
|
|
|
|
overwrite = {
|
|
|
|
|
self.guild.default_role: discord.PermissionOverwrite(read_messages=False),
|
|
|
|
|
self.guild.me: discord.PermissionOverwrite(read_messages=True)
|
|
|
|
@ -165,7 +165,7 @@ class Game:
|
|
|
|
|
return not self.can_vote or not self.day_time or self.game_over
|
|
|
|
|
|
|
|
|
|
self.day_count += 1
|
|
|
|
|
embed=discord.Embed(title=random.choice(self.morning_messages).format(self.day_count))
|
|
|
|
|
embed = discord.Embed(title=random.choice(self.morning_messages).format(self.day_count))
|
|
|
|
|
for result in self.night_results:
|
|
|
|
|
embed.add_field(name=result, value="________", inline=False)
|
|
|
|
|
|
|
|
|
@ -231,9 +231,9 @@ class Game:
|
|
|
|
|
down_votes = sum(p.emoji == "👎" and not p.me for p in reaction_list)
|
|
|
|
|
|
|
|
|
|
if len(down_votes) > len(up_votes):
|
|
|
|
|
embed=discord.Embed(title="Vote Results", color=0xff0000)
|
|
|
|
|
embed = discord.Embed(title="Vote Results", color=0xff0000)
|
|
|
|
|
else:
|
|
|
|
|
embed=discord.Embed(title="Vote Results", color=0x80ff80)
|
|
|
|
|
embed = discord.Embed(title="Vote Results", color=0x80ff80)
|
|
|
|
|
|
|
|
|
|
embed.add_field(name="👎", value="**{}**".format(len(up_votes)), inline=True)
|
|
|
|
|
embed.add_field(name="👍", value="**{}**".format(len(down_votes)), inline=True)
|
|
|
|
@ -316,14 +316,14 @@ class Game:
|
|
|
|
|
await self._notify(8, data)
|
|
|
|
|
|
|
|
|
|
async def _notify(self, event, data=None):
|
|
|
|
|
for i in range(1,7): # action guide 1-6 (0 is no action)
|
|
|
|
|
for i in range(1, 7): # action guide 1-6 (0 is no action)
|
|
|
|
|
tasks = []
|
|
|
|
|
# Role priorities
|
|
|
|
|
role_order = [role for role in self.roles if role.action_list[event][1]==i]
|
|
|
|
|
role_order = [role for role in self.roles if role.action_list[event][1] == i]
|
|
|
|
|
for role in role_order:
|
|
|
|
|
tasks.append(asyncio.ensure_future(role.on_event(event, data), loop=self.loop))
|
|
|
|
|
# VoteGroup priorities
|
|
|
|
|
vote_order = [vg for vg in self.vote_groups.values() if vg.action_list[event][1]==i]
|
|
|
|
|
vote_order = [vg for vg in self.vote_groups.values() if vg.action_list[event][1] == i]
|
|
|
|
|
for vote_group in vote_order:
|
|
|
|
|
tasks.append(asyncio.ensure_future(vote_group.on_event(event, data), loop=self.loop))
|
|
|
|
|
if tasks:
|
|
|
|
@ -333,7 +333,7 @@ class Game:
|
|
|
|
|
############END Notify structure############
|
|
|
|
|
|
|
|
|
|
async def generate_targets(self, channel):
|
|
|
|
|
embed=discord.Embed(title="Remaining Players")
|
|
|
|
|
embed = discord.Embed(title="Remaining Players")
|
|
|
|
|
for i in range(len(self.players)):
|
|
|
|
|
player = self.players[i]
|
|
|
|
|
if player.alive:
|
|
|
|
@ -517,7 +517,7 @@ class Game:
|
|
|
|
|
await self.dead_perms(self.village_channel, player.member)
|
|
|
|
|
# Add a punishment system for quitting games later
|
|
|
|
|
|
|
|
|
|
async def kill(self, target_id, source=None, method: str=None, novisit=False):
|
|
|
|
|
async def kill(self, target_id, source=None, method: str = None, novisit=False):
|
|
|
|
|
"""
|
|
|
|
|
Attempt to kill a target
|
|
|
|
|
Source allows admin override
|
|
|
|
|