further progress

fight-fixes
Bobloy 7 years ago
parent c7eafed293
commit 976d041073

@ -22,16 +22,57 @@ class Game:
self.start_vote = 0 self.start_vote = 0
self.started = False self.started = False
self.game_over = False
self.village_channel = None
self.secret_channels = {}
async def setup(self, ctx): async def setup(self, ctx):
""" """
Runs the initial setup Runs the initial setup
1. Assign Roles
2. Create Channels
2a. Channel Permissions :eyes:
3. Check Initial role setup (including alerts)
4. Start game
""" """
if self.role_code:
if not await self.get_roles():
if not self.roles:
ctx.send("No game code set, cannot start until this is set") async def _cycle(self):
"""
Each event calls the next event
_at_start()
_at_day_start()
_at_vote()
_at_kill()
_at_day_end()
_at_night_begin()
_at_night_end()
and repeat with _at_morning_start() again
"""
await self._at_start():
async def _at_start(self):
async def _at_day_start(self):
async def _at_vote(self):
async def _at_kill(self):
async def _at_day_end(self):
async def _at_night_start(self):
async def _at_night_end(self):
async def join(self, member: discord.Member): async def join(self, member: discord.Member):
""" """

@ -36,7 +36,7 @@ class Werewolf:
await ctx.send_help() await ctx.send_help()
@ww.command() @ww.command()
async def join(self, ctx, setup_id=None): async def join(self, ctx, role_code=None):
""" """
Joins a game of Werewolf or start a new one Joins a game of Werewolf or start a new one
""" """
@ -58,21 +58,9 @@ class Werewolf:
ctx.send(out) ctx.send(out)
@ww.command() def _get_game(self, ctx, role_code):
async def start(self, ctx):
"""
Vote to start a game of Werewolf
"""
game = self._get_game(ctx)
out = await game.start_vote(ctx.author)
ctx.send(out)
def _get_game(self, ctx, setup):
if ctx.guild.id not in self.games: if ctx.guild.id not in self.games:
self.games[ctx.guild.id] = Game() self.games[ctx.guild.id] = Game(role_code)
return self.games[ctx.guild.id] return self.games[ctx.guild.id]

Loading…
Cancel
Save