async def proceed(self, ctx): """Delve deeper into the mine. You must complete the current room before proceeding.""" delve = self.delves[ctx.channel.name] if delve.zone.name == 'Boon Mine' and delve.depth >= 10: await delve.channel.send('You have reached the end of Boon Mine.') return delve.proceed() for char in delve.characters: if char.update_depth_progress(delve.zone, delve.depth): await delve.channel.send( utilities.green( f'{char.name} has reached a new depth and gained a level up!' )) await asyncio.sleep(2) await delve.channel.send( utilities.blue('{}\n\n{}'.format(delve.current_room.name, delve.current_room.description))) if isinstance(delve.current_room.encounter, Loot): await self.encounter_loot(self.delves[ctx.channel.name]) elif isinstance(delve.current_room.encounter, Fight): await self.encounter_fight(self.delves[ctx.channel.name])
async def look(self, ctx): """Display the current room description and contents again.""" current_room = self.delves[ctx.channel.name].current_room await ctx.channel.send( utilities.blue('{} - d{}\n\n{}'.format( current_room.name, self.delves[ctx.channel.name].depth, current_room.description)))
async def choose(self, ctx, profession: str): """Choose a profession: jeweler, alchemist, or cartographer. Note: this choice is difficult to undo!""" character = self.get(ctx.author) if character.profession != '': await ctx.author.send( utilities.yellow( f'You have already chosen the {character.profession} trade.' )) return if profession == 'jeweler': character.profession = 'jeweler' character.save() await self.bot.get_channel(workshop_channel_id).send( f'{self.name} announces, "Congratulations to {character.name}, our newest {character.profession}!"' ) elif profession == 'alchemist': character.profession = 'alchemist' character.save() await self.bot.get_channel(workshop_channel_id).send( f'{self.name} announces, "Congratulations to {character.name}, our newest {character.profession}!"' ) elif profession == 'cartographer': # character.profession = 'cartographer' # character.save() # await self.bot.get_channel(workshop_channel_id).send( # f'{self.name} announces, "Congratulations to {character.name}, our newest {character.profession}!"') await ctx.author.send( utilities.blue( f'{self.name} says, "I\'m not currently taking new students in the {profession} trade."' )) else: await ctx.author.send( utilities.blue( f'{self.name} says, "I\'m afraid I don\'t know the {profession} trade."' ))
async def request_delve(self, ctx, leader: discord.Member, players: [discord.Member], zone: Zone, restart: bool): overwrites = { ctx.guild.default_role: discord.PermissionOverwrite(read_messages=False), ctx.guild.me: discord.PermissionOverwrite(read_messages=True), leader: discord.PermissionOverwrite(read_messages=True) } for player in players: overwrites[player] = discord.PermissionOverwrite( read_messages=True) category = discord.utils.get(ctx.guild.categories, name='Delve RPG') channel = await ctx.guild.create_text_channel('{}-{}'.format( leader.name, zone.name), overwrites=overwrites, category=category) self.delves[channel.name] = Delve(ctx.bot, leader, players, zone, channel, restart) for player in players: await player.send('Your delve has begun! Please join <#{}>'.format( channel.id)) if restart: await channel.send( 'The party has re-entered {} at depth {}.'.format( zone.name, zone.level)) else: await channel.send('The party has entered {} at depth {}.'.format( zone.name, zone.level)) current_room = self.delves[channel.name].current_room await asyncio.sleep(2) await channel.send( utilities.blue('{}\n\n{}'.format(current_room.name, current_room.description))) if isinstance(current_room.encounter, Loot): await self.encounter_loot(self.delves[channel.name]) elif isinstance(current_room.encounter, Fight): await self.encounter_fight(self.delves[channel.name])
async def cartographers(self, ctx): """Learn about the cartographer profession.""" await ctx.author.send( utilities.blue(f'{self.name} says, "{cartographer_desc}"'))
async def alchemists(self, ctx): """Learn about the alchemist profession.""" await ctx.author.send( utilities.blue(f'{self.name} says, "{alchemist_desc}"'))
async def professions(self, ctx): """Learn about the available professions.""" await ctx.author.send( utilities.blue(f'{self.name} says, "{professions_desc}"'))