Esempio n. 1
0
 async def inventory(self, ctx):
     user = (ctx.author.id, )
     async with aiosqlite.connect(PATH) as conn:
         c = await conn.execute(
             """
             SELECT * FROM Items
             WHERE owner_id = ? AND is_equipped = 1""", user)
         inv = await c.fetchall()
         c = await conn.execute(
             """
             SELECT * FROM Items
             WHERE owner_id = ? AND is_equipped = 0""", user)
         for item in (await c.fetchall()):
             inv.append(item)
         invpages = []
         for i in range(0, len(inv), 5):  #list 5 entries at a time
             invpages.append(self.write(
                 i, inv, ctx.author.id))  # Write will create the embeds
     if len(invpages) == 0:
         await ctx.reply('Your inventory is empty!')
     else:
         inventory = menus.MenuPages(
             source=PageSourceMaker.PageMaker(invpages),
             clear_reactions_after=True,
             delete_message_after=True)
         await inventory.start(ctx)
Esempio n. 2
0
    async def invest(self, ctx):
        """[COMPTROLLER] Learn how the invest command works. For more info just do `invest`."""
        with open(Links.tutorial, "r") as f:
            tutorial = f.readlines()

            embed1 = discord.Embed(
                title='Ayesha Tutorial: Invest',
                color=self.client.ayesha_blue,
                description='```invest <type : combat/sales/travel>```')
            embed1.add_field(
                name='The Invest Command',
                value=
                f"{tutorial[58]}\n{tutorial[59]}\n{tutorial[60]}\n{tutorial[61]}\n{tutorial[62]}\n{tutorial[63]}"
            )

            embed2 = discord.Embed(title='Ayesha Tutorial: Invest',
                                   color=self.client.ayesha_blue)
            embed2.add_field(
                name='Invest Enhance',
                value=
                f'{tutorial[66]}\n{tutorial[67]}\n{tutorial[68]}\n{tutorial[69]}'
            )

            tutorial_pages = menus.MenuPages(source=PageSourceMaker.PageMaker(
                [embed1, embed2]),
                                             clear_reactions_after=True,
                                             delete_message_after=True)
            await tutorial_pages.start(ctx)
Esempio n. 3
0
    async def acolytelist(self, ctx):
        """See the list of all acolytes attainable ingame."""
        with open(Links.acolyte_list, "r") as f:
            info = json.load(f)

        acolyte_embeds = []
        for acolyte in info:
            embed = discord.Embed(title=f"{info[acolyte]['Name']}",
                                  color=self.client.ayesha_blue)
            if info[acolyte]['Image'] is not None:
                embed.set_thumbnail(url=info[acolyte]['Image'])
            embed.add_field(name="Backstory",
                            value=f"{info[acolyte]['Story']}")
            embed.add_field(name='Effect',
                            value=f"{info[acolyte]['Effect']}",
                            inline=False)
            embed.add_field(
                name="Stats",
                value=
                f"Attack: {info[acolyte]['Attack']} + {info[acolyte]['Scale']}/lvl\nCrit: {info[acolyte]['Crit']}\nHP: {info[acolyte]['HP']}"
            )
            embed.add_field(
                name="Details",
                value=
                f"Rarity: {info[acolyte]['Rarity']}\u2B50\nUpgrade Material: {info[acolyte]['Mat'].title()}"
            )
            acolyte_embeds.append(embed)

        acolyte_embeds = PageSourceMaker.PageMaker.number_pages(acolyte_embeds)
        acolist = menus.MenuPages(
            source=PageSourceMaker.PageMaker(acolyte_embeds),
            clear_reactions_after=True,
            delete_message_after=True)
        await acolist.start(ctx)
Esempio n. 4
0
    async def help(self, ctx, *, helpquery : str = None):
        """The one-stop help command for Ayesha. Do `help` to view all the cog names, then `help <cog>` to get a list of commands for that module.
        You can also do `help <command>` to get help on a specific command.
        """
        # -- GIVE MENU OF COGS --
        if helpquery is None: 
            # Gives a basic menu listing every cog name a short description (the cog's docstring)
            # Therefore this command only works if everything is well documented (which it isn't)
            cog_info = {cog.qualified_name:(cog.qualified_name, cog.description) for cog in self.client.cogs.values()}

            for name in ['Admin', 'HelpCommand', 'Vote', 'Error_Handler']:
                cog_info.pop(name) #These cogs should remain hidden from users

            embed = discord.Embed(title='Ayesha Help: Cogs', 
                                  description=f'__**Please enter **__**`{ctx.prefix}help <Module>`**__** for more info on that module**__',
                                  color=self.client.ayesha_blue)
            embed.set_thumbnail(url=ctx.author.avatar_url)
            embed.set_footer(text=f'Use the {ctx.prefix}tutorial command to get started!')

            for cog in cog_info.values():
                embed.add_field(name=cog[0], value=f"{cog[1]}")

            return await ctx.reply(embed=embed)

        # -- GIVE HELP FOR A CERTAIN COG --
        helpquery = helpquery.lower()
        cogs = {name.lower():name for name in self.client.cogs} #Get all cog names in convenient way

        if helpquery in cogs:
            listCommands = self.client.get_cog(cogs[helpquery]).get_commands()
            entries = [self.write_help_embed(ctx, i, listCommands, cogs[helpquery]) for i in range(0, len(listCommands), 5)]
            #For spacing reasons, only 5 entries will be displayed at a time --> write_help_embed() will create the embeds
                
            pages = menus.MenuPages(source=PageSourceMaker.PageMaker(entries), 
                                    clear_reactions_after=True, 
                                    delete_message_after=True)
            return await pages.start(ctx) # Outputs the cog help, else searches for a command

        # -- GIVE HELP FOR A SPECIFIC COMMAND --
        command = self.client.get_command(helpquery) #All commands should be lowercase
        if command is None:
            return await ctx.reply('No command was found')

        command_info = self.write_help_for_command(command)
        embed = discord.Embed(title=command_info['name'],
                              description=command_info['help'],
                              color=self.client.ayesha_blue)
        embed.set_thumbnail(url=ctx.author.avatar_url)
        await ctx.reply(embed=embed)
Esempio n. 5
0
    async def travel(self, ctx, *, destination: str = None):
        """`destination`: where on the map you are travelling to. Leave blank to see a menu of valid areas.

        Travel to another area of the map, unlocking a different subset of commands.
        """
        if destination is None:
            locations = self.write()
            locations = PageSourceMaker.PageMaker.number_pages(locations)
            travel_pages = menus.MenuPages(
                source=PageSourceMaker.PageMaker(locations),
                clear_reactions_after=True,
                delete_message_after=True)
            await travel_pages.start(ctx)
            return

        adv = await AssetCreation.getAdventure(self.client.pg_con,
                                               ctx.author.id)
        if adv['adventure'] is not None:
            await ctx.reply(
                'You are currently traveling. Please wait until you arrive at your destination before traveling again.'
            )
            return

        destination = destination.title()

        if await AssetCreation.getLocation(self.client.pg_con,
                                           ctx.author.id) == destination:
            await ctx.reply('You are already there!')
            return

        try:
            loc = location_dict[f'{destination}']
        except KeyError:
            await ctx.reply('That is not a valid location.')
            return

        cd = time.time() + loc[
            'CD']  # Adventure time varies depending on region
        cd = int(cd)

        # Start the adventure and input end time and destination into database
        await AssetCreation.setAdventure(self.client.pg_con, cd, destination,
                                         ctx.author.id)

        # Tell player when their adventure will be done
        await ctx.reply(
            f"You will arrive at `{destination}` in `{self.convertagain(loc['CD'])}`."
        )
Esempio n. 6
0
    async def pve(self, ctx):
        """Learn the game."""
        # with open(Links.tutorial, "r") as f:
        #     tutorial = f.readlines()

        # embed1 = discord.Embed(title='Ayesha Tutorial: PvE', color=self.client.ayesha_blue)
        # embed1.add_field(name='Everything on PvE',
        #                  value=f"{tutorial[38]}\n{tutorial[39]}\n{tutorial[40]}\n{tutorial[41]}\n{tutorial[42]}\n{tutorial[43]}")
        p = ctx.prefix

        embed1 = discord.Embed(color=self.client.ayesha_blue)
        embed1.set_author(name='Ayesha Tutorial: PvE',
                          icon_url=self.client.user.avatar_url)
        embed1.set_thumbnail(url=ctx.author.avatar_url)

        embed1.add_field(
            name=f"Everything on PvE",
            value=
            (f"PvE has 25 levels, which can be viewed with `{p}pve`. "
             f"To fight a specific boss, do `{p}pve <level>`.\n\n"
             f"PvE, also known as bounties, utilize all your stats and effects "
             f"from your level, class, origin, weapon, acolytes, and brotherhood. "
             f"When you defeat a boss, you will gain lots of gold and xp, and "
             f"possibly a weapon. Losing heavily reduces the xp you gain."))

        embed1.add_field(
            name=f"Strategy",
            value=
            (f"Likewise, some bosses have increased attack or HP, or a special "
             f"effect that can buff or nerf your fighting ability. "
             f"Some bosses have special effects that may make you rethink how "
             f"to approach them. You can use the `strategy` command to set how "
             f"you want to fight: do you want to heal more? do you want to parry more?"
             ),
            inline=False)

        embed2 = self.ty_embed(p, ctx.author.avatar_url)

        pages = PageMaker.number_pages([embed1, embed2])
        tutorial_pages = menus.MenuPages(
            source=PageSourceMaker.PageMaker(pages),
            clear_reactions_after=True,
            delete_message_after=True)
        await tutorial_pages.start(ctx)
Esempio n. 7
0
    async def members(self, ctx):
        """See a list of all your college's members, their rank, and some stats."""
        # Get the list of members, theoretically sorted by rank
        guild = await AssetCreation.getGuildFromPlayer(self.client.pg_con,
                                                       ctx.author.id)
        members = await AssetCreation.getGuildMembers(self.client.pg_con,
                                                      guild['ID'])
        # Sort them into dpymenus pages
        member_list = []

        async def write(start, members):
            page = discord.Embed(title=f"{guild['Name']}: Members")
            iteration = 0

            while start < len(members) and iteration < 10:
                # attack, crit = await AssetCreation.getAttack(self.client.pg_con, members[start][0])
                battle_stats = await AssetCreation.get_attack_crit_hp(
                    self.client.pg_con, members[start][0])
                level = await AssetCreation.getLevel(self.client.pg_con,
                                                     members[start][0])
                player = await self.client.fetch_user(members[start][0])
                page.add_field(
                    name=
                    f'{player.name}: {members[start][1]} [{members[start][2]}]',
                    value=
                    f"Level `{level}`, with `{battle_stats['Attack']}` attack and `{battle_stats['Crit']}` crit.",
                    inline=False)
                start += 1
                iteration += 1

            return page

        for i in range(0, len(members), 10):
            member_list.append(await write(i, members))

        member_list = PageSourceMaker.PageMaker.number_pages(member_list)
        member_pages = menus.MenuPages(
            source=PageSourceMaker.PageMaker(member_list),
            clear_reactions_after=True,
            delete_message_after=True)
        await member_pages.start(ctx)
Esempio n. 8
0
    async def tavern(self, ctx):
        """View a list of all the acolytes you own.
        Each acolyte has an ID number listed next to them, with which you can reference them in other commands.
        """
        inv = await AssetCreation.getAllAcolytesFromPlayer(
            self.client.pg_con, ctx.author.id)

        invpages = []
        for i in range(0, len(inv), 5):  #list 5 entries at a time
            invpages.append(await self.write(
                i, inv,
                ctx.author.display_name))  # Write will create the embeds
        if len(invpages) == 0:
            await ctx.reply('Your tavern is empty!')
        else:
            invpages = PageSourceMaker.PageMaker.number_pages(invpages)
            tavern = menus.MenuPages(
                source=PageSourceMaker.PageMaker(invpages),
                clear_reactions_after=True,
                delete_message_after=True)
            await tavern.start(ctx)
Esempio n. 9
0
    async def _list(self, ctx):
        """Get a list of your active reminders. Each reminder has an ID that can be referenced in other commands."""
        reminders = await AssetCreation.get_reminders_from_person(
            self.client.pg_con, ctx.author.id)

        if len(reminders) == 0:
            await ctx.reply('You have no reminders!')
            return

        remind_pages = []
        for i in range(0, len(reminders), 5):  #list 5 entries at a time
            remind_pages.append(
                self.write(
                    i, reminders,
                    ctx.author.display_name))  # Write will create the embeds

        remind_pages = PageSourceMaker.PageMaker.number_pages(remind_pages)
        remind_list = menus.MenuPages(
            source=PageSourceMaker.PageMaker(remind_pages),
            clear_reactions_after=True,
            delete_message_after=True)
        await remind_list.start(ctx)
Esempio n. 10
0
    async def bounty(self, ctx, level : int = 0):
        """`level`: the level of the PvE you want to fight. Leave blank to see a menu of bosses.

        Fight an enemy for rewards, gaining xp, gold, and possibly an item.
        """
        if level == 0:
            levels = self.showBounties()
            levels = PageSourceMaker.PageMaker.number_pages(levels)
            pages = menus.MenuPages(source=PageSourceMaker.PageMaker(levels), 
                                    clear_reactions_after=True, 
                                    delete_message_after=True)
            await pages.start(ctx)
            #Show the list of enemies
            ctx.command.reset_cooldown(ctx)
            return
        if level < 1 or level > 25:
            await ctx.reply('Please supply a valid level.')
            ctx.command.reset_cooldown(ctx)
            return

        # GET PLAYER INFO AND LOAD THEIR STATS
        player1 = await AssetCreation.get_player_battle_info(self.client.pg_con, ctx.author.id)
        boss = bounty_levels[level].copy()

        # CREATE THE EMBED
        embed = discord.Embed(title=f"{boss['Name']} attacks!",
                              color = self.client.ayesha_blue)
        embed.add_field(name='Attack', value=f"{player1['Attack']}") #field 0
        embed.add_field(name='Crit Rate', value=f"{player1['Crit']}") #field 1
        embed.add_field(name='HP', value=f"{player1['HP']}") #field 2
        embed.add_field(name=f"Enemy HP: `{boss['HP']}`",
                        value=f'ЁЯЧбя╕П Attack , \N{SHIELD} Block, \N{CROSSED SWORDS} Parry, \u2764 Heal, \u23F1 Bide',
                        inline=False) #field 3
        embed.add_field(name='You get initiative', value='Turn `0`') #field 4
        if boss['Image'] is not None:
            embed.set_thumbnail(url=boss['Image'])

        message = await ctx.reply(embed=embed)

        # BEGIN THE BATTLE
        turn_counter = 0

        player1, boss = AssetCreation.apply_boss_game_begin(player1, boss)

        while True: #This should be broken eventually and never loop infinitely
            player1['Action'] = random.choices(['attacked', 'blocked', 'parried', 'healed', 'bided'],
                                            [player1['Strategy']['attack'],
                                             player1['Strategy']['block'],
                                             player1['Strategy']['parry'],
                                             player1['Strategy']['heal'],
                                             player1['Strategy']['bide']])[0]
            boss_action = 'attacked'

            #Calculate changes according to the player actions

            player1['Damage'] = 0
            player1['Heal'] = 0
            boss['Damage'] = 0
            boss['Heal'] = 0

            if player1['Action'] == 'attacked':
                player1['Damage'] = random.randint(int(player1['Attack'] * .9), int(player1['Attack'] * 1.1))
                player1 = AssetCreation.apply_acolytes_with_damage(player1)

                boss['Damage'] = random.randint(int(boss['Attack'] * .9), int(boss['Attack'] * 1.1))
                
                if random.randint(1,100) < player1['Crit']:
                    player1, boss = self.apply_crit(player1, boss)

            elif player1['Action'] == 'blocked':
                player1['Damage'] = random.randint(int(player1['Attack'] / 20), int(player1['Attack'] / 10))
                player1 = AssetCreation.apply_acolytes_with_damage(player1)

                boss['Damage'] = random.randint(0, int(boss['Attack'] / 10))

                if random.randint(1,100) < player1['Crit']:
                    player1, boss = self.apply_crit(player1, boss)

            elif player1['Action'] == 'parried':
                player1['Damage'] = random.randint(int(player1['Attack'] * .4), int(player1['Attack'] * .6))
                player1 = AssetCreation.apply_acolytes_with_damage(player1)

                boss['Damage'] = random.randint(int(boss['Attack'] * .35), int(boss['Attack'] * .55))
                
                if random.randint(1,100) < player1['Crit']:
                    player1, boss = self.apply_crit(player1, boss)

                player1, boss = AssetCreation.apply_boss_parry(player1, boss)

            elif player1['Action'] == 'healed':
                player1['Damage'] = 0
                player1 = AssetCreation.apply_acolytes_with_damage(player1)
                player1['Heal'] = random.randint(100,200)

                boss['Damage'] = random.randint(int(boss['Attack'] * .65), int(boss['Attack'] * .9))

            else:
                player1['Damage'] = 0
                player1 = AssetCreation.apply_acolytes_with_damage(player1)
                player1['Heal'] = random.randint(25,75)
                player1['Attack'] = int(player1['Attack'] * 1.25)

                boss['Damage'] = random.randint(int(boss['Attack'] * .65), int(boss['Attack'] * .9))

            player1, boss = AssetCreation.apply_acolytes_on_turn_end(player1, boss, turn_counter)
            player1, boss = AssetCreation.apply_boss_turn_end(player1, boss, turn_counter)

            if player1['Class'] == 'Butcher':
                player1['Heal'] *= 2
            elif player1['Class'] == 'Leatherworker':
                boss['Damage'] = int(boss['Damage'] * .85)

            #Calculate actual combat changes
            player1['HP'] += player1['Heal'] - boss['Damage']
            boss['HP'] += boss['Heal'] - player1['Damage']

            if player1['HP'] > player1['Max_HP']:
                player1['HP'] = player1['Max_HP']

            #Check to see if HP falls below 0
            if boss['HP'] <= 0: #Give player win in event of a tie
                embed = await self.send_victory_embed(player1, boss, level)
                await message.edit(embed=embed)
                if player1['Acolyte1']['ID'] is None and player1['Acolyte2']['ID'] is None:
                    await AssetCreation.checkLevel(self.client.pg_con, ctx, ctx.author.id)
                elif player1['Acolyte1']['ID'] is not None and player1['Acolyte2']['ID'] is None:
                    await AssetCreation.checkLevel(self.client.pg_con, ctx, ctx.author.id, aco1=player1['Acolyte1']['ID'])
                elif player1['Acolyte1']['ID'] is None and player1['Acolyte2']['ID'] is not None:
                    await AssetCreation.checkLevel(self.client.pg_con, ctx, ctx.author.id, aco2=player1['Acolyte2']['ID'])
                else:
                    await AssetCreation.checkLevel(self.client.pg_con, ctx, ctx.author.id, aco1=player1['Acolyte1']['ID'], aco2=player1['Acolyte2']['ID'])
                return

            elif player1['HP'] <= 0:
                embed = await self.send_loss_embed(player1, boss, level)
                await message.edit(embed=embed)
                if player1['Acolyte1']['ID'] is None and player1['Acolyte2']['ID'] is None:
                    await AssetCreation.checkLevel(self.client.pg_con, ctx, ctx.author.id)
                elif player1['Acolyte1']['ID'] is not None and player1['Acolyte2']['ID'] is None:
                    await AssetCreation.checkLevel(self.client.pg_con, ctx, ctx.author.id, aco1=player1['Acolyte1']['ID'])
                elif player1['Acolyte1']['ID'] is None and player1['Acolyte2']['ID'] is not None:
                    await AssetCreation.checkLevel(self.client.pg_con, ctx, ctx.author.id, aco2=player1['Acolyte2']['ID'])
                else:
                    await AssetCreation.checkLevel(self.client.pg_con, ctx, ctx.author.id, aco1=player1['Acolyte1']['ID'], aco2=player1['Acolyte2']['ID'])
                return

            turn_counter += 1
            if turn_counter >= 51:
                #Return finished embed
                embed = await self.send_loss_embed(player1, boss, level)
                await message.edit(embed=embed)
                break

            #Send new embed
            embed.set_field_at(0, name='Attack', value=f"{player1['Attack']}")
            embed.set_field_at(1, name='Crit Rate', value=f"{player1['Crit']}")
            embed.set_field_at(2, name='HP', value=f"{player1['HP']}")
            embed.set_field_at(3, name=f"Enemy HP: `{boss['HP']}`", 
                               value=f'ЁЯЧбя╕П Attack , \N{SHIELD} Block, \N{CROSSED SWORDS} Parry, \u2764 Heal, \u23F1 Bide',
                               inline=False)
            embed.set_field_at(4, name=f"Turn `{turn_counter}`",
                               value=f"You {player1['Action']}, dealing {player1['Damage']} damage and healing {player1['Heal']}.\n{boss['Name']} {boss_action} and dealt {boss['Damage']} damage, healing for {boss['Heal']}.")
            
            await message.edit(embed=embed)

            await asyncio.sleep(2)
Esempio n. 11
0
    async def inventory(self, ctx, *, query=''):
        """`query`: the way you want to sort your items. Put a weapontype, rarity, and order by attack or crit.

        View your inventory of items. Each item has an ID listed netx to its name that can be referenced for related commands.
        You can also sort specifically by weapontype, rarity, and order by attack or crit. Simply add the things you want to sort by in the command to get a smaller inventory.
        For example, to get all common swords in your inventory, do `%inventory common sword`. You can also do `%inventory crit` to sort all your weapons by crit.
        """
        #Create a list of all the queries for individual filtering
        sort = [term.title() for term in query.split()]

        #These functions will see how the items are sorted
        def filter_weapontypes(query):
            weapontypes = self.client.weapontypes
            if query in weapontypes:
                return True
            else:
                return False

        def filter_rarity(query):
            rarities = ['Common', 'Uncommon', 'Rare', 'Epic', 'Legendary']
            if query in rarities:
                return True
            else:
                return False

        def filter_metric(query):
            stats = ['Attack', 'Crit']
            if query in stats:
                return True
            else:
                return False

        filtered_type = filter(filter_weapontypes, sort)
        filtered_rarity = filter(filter_rarity, sort)
        filtered_stat = filter(filter_metric, sort)

        try:
            weapontype = list(filtered_type)[0]
        except IndexError:
            weapontype = None

        try:
            rarity = list(filtered_rarity)[0]
        except IndexError:
            rarity = None

        try:
            stat = list(filtered_stat)[0]
        except IndexError:
            stat = 'attack'

        #Retrieve the player's inventory based off the queries, but put equipped item first always
        inventory = []
        equipped_item = await self.client.pg_con.fetchrow(
            'SELECT item_id, weapontype, attack, crit, weapon_name, rarity, is_equipped FROM items WHERE owner_id = $1 AND is_equipped = True',
            ctx.author.id)
        if equipped_item is not None:
            inventory.append(equipped_item)

        psql = 'SELECT item_id, weapontype, attack, crit, weapon_name, rarity, is_equipped FROM items WHERE owner_id = $1 AND is_equipped = False '

        if stat == 'attack':
            psql2 = ' ORDER BY attack DESC'
        else:
            psql2 = ' ORDER BY crit DESC'

        if weapontype is not None and rarity is not None:
            psql += 'AND weapontype = $2 AND rarity = $3 ' + psql2
            inv = await self.client.pg_con.fetch(psql, ctx.author.id,
                                                 weapontype, rarity)

        elif weapontype is None and rarity is not None:
            psql += 'AND rarity = $2 ' + psql2
            inv = await self.client.pg_con.fetch(psql, ctx.author.id, rarity)

        elif weapontype is not None and rarity is None:
            psql += 'AND weapontype = $2 ' + psql2
            inv = await self.client.pg_con.fetch(psql, ctx.author.id,
                                                 weapontype)

        else:
            psql += psql2
            inv = await self.client.pg_con.fetch(psql, ctx.author.id)

        for item in inv:
            inventory.append(item)

        invpages = []
        for i in range(0, len(inv), 5):  #list 5 entries at a time
            invpages.append(self.write(
                i, inventory,
                ctx.author.display_name))  # Write will create the embeds
        if len(invpages) == 0:
            await ctx.reply('Your inventory is empty!')
        else:
            invpages = PageSourceMaker.PageMaker.number_pages(invpages)
            inventory = menus.MenuPages(
                source=PageSourceMaker.PageMaker(invpages),
                clear_reactions_after=True,
                delete_message_after=True)
            await inventory.start(ctx)
Esempio n. 12
0
    async def Items(self, ctx):
        """Learn the game."""
        p = ctx.prefix

        embed1 = discord.Embed(color=self.client.ayesha_blue)
        embed1.set_author(name='Ayesha Tutorial: Items',
                          icon_url=self.client.user.avatar_url)
        embed1.set_thumbnail(url=ctx.author.avatar_url)

        embed1.add_field(
            name=f"Item Overview",
            value=
            (f"You can have one weapon equipped at any time and are the "
             f"easiest way to increase your ATK and Crit stats.\n\n"
             f"You can view all your owned weapons with the `{p}inventory` command. "
             f"Alongside its Attack, and Crit, each item has an ID, the number "
             f"next to its name, which you use when you want to use other "
             f"commands on an item."))
        embed1.add_field(
            name=f"Weapontype and Rarity",
            value=
            (f"Each weapon also has one of 13 types and one of 5 rarities.\n\n"
             f"Equipping a weapon of a certain type might give you a 20 ATK bonus, "
             f"depending on your class. The weapontypes associated with your class "
             f"can be found in the `{p}class` menu.\n\n"
             f"Your weapontype might also affect your rewards from `{p}mine`, "
             f"`{p}hunt`, and `{p}forage`.\n\n"
             f"You can filter through your inventory by weapontype and rarity. "
             f"To see all your maces, do `{p}inventory mace`, and to see all "
             f"your epic items, do `{p}inventory epic`. To see all of your "
             f"epic maces, do `{p}inventory epic mace`."),
            inline=False)

        embed2 = discord.Embed(color=self.client.ayesha_blue)
        embed2.set_author(name='Ayesha Tutorial: Items',
                          icon_url=self.client.user.avatar_url)
        embed2.set_thumbnail(url=ctx.author.avatar_url)

        embed2.add_field(
            name=f"Upgrading Items",
            value=
            (f"Items have a certain range of ATK and Crit based off its rarity, "
             f"but the ATK value can be increased up to a point. The first way "
             f"is via the `{p}upgrade` command. Upgrading can only be done in "
             f"urban areas, and costs you gold and iron. There is also a limit "
             f"to the ATK you can upgrade to depending on the item's rarity.\n\n"
             f"The `{p}merge` command can boost an item's attack past the limit "
             f"of `{p}upgrade`. Merging, however, requires a weaker weapon of "
             f"the same weapontype to be destroyed. Blacksmiths can use the "
             f"`{p}forge` command, which costs more than `{p}merge`, but "
             f"raise the weapon's attack more."))
        embed2.add_field(
            name=f"Selling Items",
            value=
            (f"You can sell items you no longer want for gold. "
             f"The `{p}sell` command will let you sell any single item. You can "
             f"also list multiple IDs with `{p}sellmultiple` or sell all your items "
             f"of a specific rarity with `{p}sellall`. None of these commands will "
             f"net you more gold per weapon and exist for convenience.\n\n"
             f"Alternatively, you can `{p}offer` your unwanted strong weapons "
             f"to other players for a price."),
            inline=False)

        embed3 = self.ty_embed(p, ctx.author.avatar_url)

        pages = PageMaker.number_pages([embed1, embed2, embed3])
        tutorial_pages = menus.MenuPages(
            source=PageSourceMaker.PageMaker(pages),
            clear_reactions_after=True,
            delete_message_after=True)
        await tutorial_pages.start(ctx)
Esempio n. 13
0
    async def Acolytes(self, ctx):
        """Learn the game."""
        p = ctx.prefix

        embed1 = discord.Embed(color=self.client.ayesha_blue)
        embed1.set_author(name='Ayesha Tutorial: Acolytes',
                          icon_url=self.client.user.avatar_url)
        embed1.set_thumbnail(url=ctx.author.avatar_url)

        embed1.add_field(
            name='What are Acolytes?',
            value=
            (f"Acolytes are your friends, teammates who fight alongside you in battle. "
             f"They boost your ATK, Crit, and HP, and may have another effect that "
             f"enhances your gameplay.\n\n"
             f"Acolytes are obtained from the `{p}roll` command. There are five "
             f"rarities, from 1⭐ to 5⭐. You have a base 1% chance of rolling "
             f"5⭐ on any roll, but are guaranteed to get one on your 80th "
             f"summon since your 5⭐ or legendary roll."))

        embed2 = discord.Embed(color=self.client.ayesha_blue)
        embed2.set_author(name='Ayesha Tutorial: Acolytes',
                          icon_url=self.client.user.avatar_url)
        embed2.set_thumbnail(url=ctx.author.avatar_url)

        embed2.add_field(
            name='How do I equip my acolytes?',
            value=
            (f"You can view all your acolytes with the `{p}tavern` command.\n\n"
             f"It lists each acolyte, its level and stats, and effect if it has one."
             f"Next to its name is its ID. To add an acolyte to your team, do"
             f"`{p}recruit <ID> <1-2>` to equip it in your 1st or 2nd slot.\n\n"
             f"You only have 2 slots for acolytes, so make sure you choose wisely!"
             ))

        embed3 = discord.Embed(color=self.client.ayesha_blue)
        embed3.set_author(name='Ayesha Tutorial: Acolytes',
                          icon_url=self.client.user.avatar_url)
        embed3.set_thumbnail(url=ctx.author.avatar_url)

        embed3.add_field(
            name='How do I strengthen my acolytes?',
            value=
            (f"The first way to level up your acolytes is passively. For every "
             f"10 xp you earn, your equipped acolytes will earn 1.\n\n"))

        embed3.add_field(
            name='The Second Way: Adventure Awaits!',
            value=
            (f"The second, faster way is with the `{p}train` command. But wait! "
             f"This will require a long and arduous adventure!\n"
             f"If you do `{p}acolyte <Acolyte Name>`, you can see expanded "
             f"information about that acolyte."
             f"Try `{p}acolyte Ayesha`. You will notice that under the 'Details' "
             f"category, it says 'Upgrade Material: Oat'. If you have Ayesha "
             f"and want to level her, that means you have to obtain and use oats."
             f"In order to do that, there are three commands at your service:\n"
             f"**  -** `{p}travel`\n"
             f"**  -** `{p}forage`\n"
             f"**  -** `{p}expedition`\n"),
            inline=False)

        embed4 = discord.Embed(color=self.client.ayesha_blue)
        embed4.set_author(name='Ayesha Tutorial: Acolytes',
                          icon_url=self.client.user.avatar_url)
        embed4.set_thumbnail(url=ctx.author.avatar_url)

        embed4.add_field(
            name='Gathering resources for your acolyte',
            value=
            (f"You now must follow six steps: \n"
             f"**  -** Do `{p}travel` and find which location lists oats. Glakelys "
             f"has oats, so do `{p}travel Glakelys` and wait a few hours to get "
             f"to that location.\n"
             f"**  -** Once there, do `{p}arrive` to officially set your location "
             f"to Glakelys. You can see it change on your `{p}profile`.\n"
             f"**  -** `{p}forage` will actively gain you materials. Alternatively...\n"
             f"**  -** `{p}expedition` will place you on a passive adventure "
             f"in which you collect these materials over the course of a week. "
             f"You can go on expedition for as long as you want. You will gain more "
             f"rewards the longer you're gone, but only for up to a week. You can "
             f"view the length of your expedition with `{p}cooldowns`. Once finished, "
             f"do `{p}arrive` to get all your booty.\n"
             f"**  -** `{p}pack` will show you all the resources you hold. Look at "
             f"how much oat you have now!\n\n"))

        embed4.add_field(
            name='And now I can train!',
            value=
            (f"And now, finally, now that you have all the resources you need, NOW "
             f"you can `{p}train <Acolyte ID>`. Each training costs you `50` material "
             f"and `250` gold, and will net your acolyte 5,000 experience.\n"
             f"Seem slow? You can train multiple times at once. For example, "
             f"`{p}train 1 100` will train the acolyte with ID:1 100 times!"),
            inline=False)

        embed5 = self.ty_embed(p, ctx.author.avatar_url)

        pages = PageMaker.number_pages(
            [embed1, embed2, embed3, embed4, embed5])
        tutorial_pages = menus.MenuPages(
            source=PageSourceMaker.PageMaker(pages),
            clear_reactions_after=True,
            delete_message_after=True)
        await tutorial_pages.start(ctx)
Esempio n. 14
0
    async def tutorial(self, ctx):
        """Learn the game."""
        p = ctx.prefix

        embed1 = discord.Embed(color=self.client.ayesha_blue)
        embed1.set_author(name='Ayesha Tutorial: Introduction',
                          icon_url=self.client.user.avatar_url)
        embed1.set_thumbnail(url=ctx.author.avatar_url)

        embed1.add_field(
            name='Welcome to Ayesha, a new Gacha RPG for Discord!',
            value=
            (f"**∘ |** **Create a character** by doing `{p}create <your name>`.\n"
             f"**∘ |** **Customize** your playstyle with `{p}class` and `{p}origin`.\n"
             f"**∘ |** View your **profile** with the `{p}profile` command!\n"
             f"**∘ |** View your **weapons** with the `{p}inventory` command.\n"
             f"**∘ |** View your **acolytes** with `{p}tavern`.\n"
             f"**∘ |** Do `{p}pve <1-25>` to fight **bosses** and earn **rewards**!\n"
             f"**∘ |** Get passive **resources** from `{p}travel` and `{p}expedition`.\n"
             f"**∘ |** Make friends in `{p}brotherhood`s, `{p}college`s, or `{p}guild`s.\n\n"
             f"Hit the ▶️ for a quick walkthrough!\n"
             f"Still stuck? Use the `{p}help` command!"))

        embed2 = discord.Embed(color=self.client.ayesha_blue)
        embed2.set_author(name='Ayesha Tutorial: Introduction',
                          icon_url=self.client.user.avatar_url)
        embed2.set_thumbnail(url=ctx.author.avatar_url)

        embed2.add_field(
            name="Ayesha's Stat System",
            value=
            (f"**You will be seeing a bunch of terms thrown all over the game. "
             f"Here's a quick overview:**\n"
             f"**∘ | Gold:** the base currency for Ayesha, used for most anything in the game.\n"
             f"**∘ | Rubidics:** rubidics are the **gacha** currency for Ayesha. "
             f"That means it is entirely separate from gameplay, and used only for `{p}summon`ing.\n"
             f"**∘ | Level:** your character's level, which can be increased by a few important commands.\n"
             f"**∘ | Attack:** your character's attack. It can be increased based"
             f"off your weapon, acolytes, class, origin, and association.\n"
             f"**∘ | Crit:** like Attack, but denoting your critical strike chance.\n"
             f"**∘ | HP:** your hit points, used in `{p}pvp` and `{p}pve`.\n"
             f"**∘ | Gravitas:** Your **reputation** or **influence** in the bot, "
             f"an alternative stat to raise for those not interested by combat.\n\n"
             f"Hit the ▶️ for your first steps!\n"
             f"Still stuck? Join the `{p}support` server for help!"))

        embed3 = discord.Embed(color=self.client.ayesha_blue)
        embed3.set_author(name='Ayesha Tutorial: Introduction',
                          icon_url=self.client.user.avatar_url)
        embed3.set_thumbnail(url=ctx.author.avatar_url)

        embed3.add_field(
            name='Quick-Start Guide',
            value=
            (f"**∘ |** Fighting bosses is the fastest way to level up. Try doing `{p}pve 1`.\n"
             f"**∘ |** You will notice that you had set Attack, Crit, and HP stats. "
             f"There are multiple factors affecting these. The fastest way to increase "
             f"your attack is with a better weapon. Do `{p}inventory` and equip "
             f"your **Wooden Spear** by doing `{p}equip <ID>`. The ID is the number "
             f"listed next to the weapon's name in your inventory."))

        embed3.add_field(
            name='Introduction to Class and Origin',
            value=
            (f"**∘ |** Now do `{p}class` and `{p}origin`. There are 10 classes "
             f"and 9 origins, each with their own niche. Read their effects "
             f"carefully, then do `{p}class <Name>` and `{p}origin <Name>` "
             f"to take on whichever are your favorites! You can change them "
             f"again later."),
            inline=False)

        embed4 = discord.Embed(color=self.client.ayesha_blue)
        embed4.set_author(name='Ayesha Tutorial: Introduction',
                          icon_url=self.client.user.avatar_url)
        embed4.set_thumbnail(url=ctx.author.avatar_url)

        embed4.add_field(
            name='The Gacha System!',
            value=
            (f"**∘ |** To get stronger weapons and acolytes, use the `{p}roll` "
             f"command. You can roll up to 10 times at once with `{p}roll 10`.\n"
             f"**∘ |** Each summon from the gacha costs **1 rubidic**, Ayesha's "
             f"gacha currency. You start off with 10 rolls, but can gain more:\n"
             f"**  -** By levelling up (do more `{p}pve`!)\n"
             f"**  -** Doing `{p}daily` every 12 hours, for **2** rubidics.\n"
             f"**  -** And voting for the bot on the bot list! This will net you "
             f"**1** rubidic, but we are listed on two sites (do `{p}vote`). "
             f"Voting has the same cooldown as `{p}daily`, so you can do it at the "
             f"the same time everyday, twice a day, for **8** rubidics/day!"))

        embed4.add_field(
            name='Your Friendly Neighborhood Acolyte',
            value=
            (f"**∘ |** Acolytes are the most effective way to increase your ATK, "
             f"Crit, and HP, and some give other powerful effects!\n"
             f"**∘ |** Acolytes are obtained through gacha. If you've already "
             f"pulled some, you can see your list with `{p}tavern`.\n"
             f"**∘ |** Like your inventory, acolytes have an ID number, and they "
             f"are equipped with the `{p}hire` command. You can have up to 2 "
             f"acolytes equipped at any time, hence the slot being '1 or 2.'"),
            inline=False)

        embed5 = self.ty_embed(p, ctx.author.avatar_url)

        pages = PageMaker.number_pages(
            [embed1, embed2, embed3, embed4, embed5])
        tutorial_pages = menus.MenuPages(
            source=PageSourceMaker.PageMaker(pages),
            clear_reactions_after=True,
            delete_message_after=True)
        await tutorial_pages.start(ctx)