Adjust to italics, fix generate targets to be more obvious and readable, fix `night_messages` confusion with `night_results`

pull/147/head
bobloy 4 years ago
parent a691b2b85a
commit 2ab87866dd

@ -42,12 +42,12 @@ class Game:
"votegroup": None, # uninitialized VoteGroup "votegroup": None, # uninitialized VoteGroup
} }
morning_messages = [ day_start_messages = [
"**The sun rises on day {} in the village..**", "*The sun rises on day {} in the village..*",
"**Morning has arrived on day {}..**", "*Morning has arrived on day {}..*",
] ]
night_messages = ["**Dawn falls on day {}..****"] day_end_messages = ["*Dawn falls..*", "*The sun sets on the village*"]
day_vote_count = 3 day_vote_count = 3
@ -305,9 +305,9 @@ class Game:
self.action_queue.append(self._at_day_start()) self.action_queue.append(self._at_day_start())
while self.action_queue and not self.game_over: while self.action_queue and not self.game_over:
current_action = asyncio.create_task(self.action_queue.popleft()) self.current_action = asyncio.create_task(self.action_queue.popleft())
try: try:
await current_action await self.current_action
except asyncio.CancelledError: except asyncio.CancelledError:
log.debug("Cancelled task") log.debug("Cancelled task")
# #
@ -337,7 +337,7 @@ class Game:
self.day_count += 1 self.day_count += 1
# Print the results of who died during the night # Print the results of who died during the night
embed = discord.Embed(title=random.choice(self.morning_messages).format(self.day_count)) embed = discord.Embed(title=random.choice(self.day_start_messages).format(self.day_count))
for result in self.night_results: for result in self.night_results:
embed.add_field(name=result, value="________", inline=False) embed.add_field(name=result, value="________", inline=False)
@ -362,7 +362,7 @@ class Game:
if check(): if check():
return return
await self.village_channel.send( await self.village_channel.send(
embed=discord.Embed(title=f"**{HALF_DAY_LENGTH / 60} minutes of daylight remain...**") embed=discord.Embed(title=f"*{HALF_DAY_LENGTH / 60} minutes of daylight remain...*")
) )
await asyncio.sleep(HALF_DAY_LENGTH) # 4 minute days FixMe to 120 later await asyncio.sleep(HALF_DAY_LENGTH) # 4 minute days FixMe to 120 later
@ -386,7 +386,7 @@ class Game:
await self.speech_perms(self.village_channel, target.member) # Only target can talk await self.speech_perms(self.village_channel, target.member) # Only target can talk
await self.village_channel.send( await self.village_channel.send(
f"**{target.mention} will be put to trial and has 30 seconds to defend themselves**", f"*{target.mention} will be put to trial and has 30 seconds to defend themselves**",
allowed_mentions=discord.AllowedMentions(everyone=False, users=[target]), allowed_mentions=discord.AllowedMentions(everyone=False, users=[target]),
) )
@ -480,7 +480,7 @@ class Game:
await self.night_perms(self.village_channel) await self.night_perms(self.village_channel)
await self.village_channel.send( await self.village_channel.send(
embed=discord.Embed(title="**The sun sets on the village...**") embed=discord.Embed(title=random.choice(self.day_end_messages))
) )
await self._notify("at_day_end") await self._notify("at_day_end")
@ -546,7 +546,7 @@ class Game:
# ###########END Notify structure############ # ###########END Notify structure############
async def generate_targets(self, channel, with_roles=False): async def generate_targets(self, channel, with_roles=False):
embed = discord.Embed(title="Remaining Players") embed = discord.Embed(title="Remaining Players", description="[ID] - [Name]")
for i, player in enumerate(self.players): for i, player in enumerate(self.players):
if player.alive: if player.alive:
status = "" status = ""
@ -554,15 +554,14 @@ class Game:
status = "*[Dead]*-" status = "*[Dead]*-"
if with_roles or not player.alive: if with_roles or not player.alive:
embed.add_field( embed.add_field(
name=f"ID# **{i}**", name=f"{i} - {status}{player.member.display_name}",
value=f"{status}{player.member.display_name}-{player.role}", value=f"{player.role}",
inline=True, inline=False,
) )
else: else:
embed.add_field( embed.add_field(
name=f"ID# **{i}**", name=f"{i} - {status}{player.member.display_name}",
value=f"{status}{player.member.display_name}", inline=False,
inline=True,
) )
return await channel.send(embed=embed) return await channel.send(embed=embed)

Loading…
Cancel
Save