diff --git a/src/werewolf_bot.py b/src/werewolf_bot.py index bfaf7cb..84b7b4b 100644 --- a/src/werewolf_bot.py +++ b/src/werewolf_bot.py @@ -158,6 +158,7 @@ async def time(ctx): await send_friendly(ctx, game_instances[ctx.channel].remaining_time_string()) +# TODO: developer COG # smaller commands @bot.command() @@ -193,8 +194,18 @@ async def logout(ctx): @bot.command() @developer async def debug(ctx, *args): - print("DEBUG") - print(ctx.args) - print(ctx.kwargs) + embed = discord.Embed(title=f"Village won!", color=0x00ffff) + won_emoji = ":trophy:" + dead_emoji = ":test:" + tab = "\t" + space = "<:space:705863033871663185>" + embed.add_field(name=str("Name"), value=f"{won_emoji}{space}{dead_emoji}{space}{space}{3}:ballot_box:{tab}role: werewolf{tab}(was: drunk){tab}:point_right: someone", inline=False) + await ctx.send(embed=embed) + await ctx.send(":test::skull:") + + for emoji in ctx.guild.emojis: + await ctx.send(emoji) + print(emoji.id) + bot.run(TOKEN) diff --git a/src/werewolf_game.py b/src/werewolf_game.py index 255bef0..f564f2c 100644 --- a/src/werewolf_game.py +++ b/src/werewolf_game.py @@ -14,7 +14,7 @@ class Game: self.channel = channel self.player_list = [] self.role_list = [] - self.discussion_time = 300 # seconds + self.discussion_time = 301 # seconds async def send(self, message): await self.channel.send(embed=discord.Embed(description=message, color=0x00ffff)) diff --git a/src/werewolf_players.py b/src/werewolf_players.py index 13af25b..285844a 100644 --- a/src/werewolf_players.py +++ b/src/werewolf_players.py @@ -59,7 +59,7 @@ class Player: while True: def check(choice): return choice.channel == self.dm and choice.author == self.member - choice = (await self.game.bot.wait_for('message', timeout=30.0, check=check)).content.split() + choice = (await self.game.bot.wait_for('message', check=check)).content.split() if not len(choice) == n_ans: await self.send_wrong(f"Please give {n_ans} numbers not {len(choice)}") diff --git a/src/werewolf_roles.py b/src/werewolf_roles.py index ce14fb1..f7cf685 100644 --- a/src/werewolf_roles.py +++ b/src/werewolf_roles.py @@ -45,28 +45,33 @@ class Doppelganger(Role): @Role.no_player async def send_copy_info(self): self.copy_role = type(self.player.other()[self.choice].day_role) - await self.send_info(f"You copied: {self.copy_role}") + await self.player.send_info(f"You copied: {self.copy_role.name()}") @Role.no_player async def simulate(self): if self.copy_role in [Werewolf, Mason]: self.copy_role.add_yourself(self) - if self.copy_role == Werewolf: - await self.copy_role.phase(self) - if self.copy_role in [Mason, Minion]: - await self.copy_role.send_info(self) - - if self.copy_role in [Seer, Robber, Troublemaker, Drunk]: + elif self.copy_role in [Seer, Robber, Troublemaker, Drunk]: await self.copy_role.query(self) if self.copy_role in [Robber, Troublemaker, Drunk]: - self.copy_role.simulate(self) + await self.copy_role.simulate(self) if self.copy_role in [Seer, Robber]: await self.copy_role.send_info(self) + @Role.no_player + async def phase(self): + if self.copy_role == Werewolf: + await self.copy_role.phase(self) + + @Role.no_player + async def send_info(self): + if self.copy_role in [Mason, Minion]: + await self.copy_role.send_info(self) + @Role.no_player async def insomniac(self): if self.copy_role == Insomniac: - self.copy_role.send_info(self) + await self.copy_role.send_info(self) def is_role(self, cls): return self.copy_role == cls @@ -113,10 +118,10 @@ class Seer(Role): @Role.no_player async def send_info(self): if self.choice < len(self.player.other()): - await self.player.send_info(self.player.other()[self.choice].night_role) + await self.player.send_info(f"You saw: {self.player.other()[self.choice].night_role.name()}") else: a, b = [(0, 1), (1, 2), (0, 2)][self.choice - len(self.player.other())] - await self.player.send_info(f"{self.game.middle_card[a]} {self.game.middle_card[b]}") + await self.player.send_info(f"You saw: {self.game.middle_card[a]} {self.game.middle_card[b]}") class Robber(Role): @@ -130,7 +135,7 @@ class Robber(Role): @Role.no_player async def send_info(self): - await self.player.send_info(f"You robbed: {self.player.day_role}") + await self.player.send_info(f"You robbed: {self.player.day_role.name()}") class Troublemaker(Role): @@ -156,7 +161,7 @@ class Drunk(Role): class Insomniac(Role): @Role.no_player async def send_info(self): - await self.player.send_info(f"You are: {self.player.day_role}") + await self.player.send_info(f"You are: {self.player.day_role.name()}") class Villager(Role):