示例#1
0
文件: bot.py 项目: tarngaina/msd
async def stat(ctx, *, param=None):
    p = player.find(ctx.author.id)
    if param == None:
        embed = discord.Embed(title=f'**{ctx.author.name}**',
                              description='**STAT**',
                              color=constant.ColorHex.green)
        embed.set_thumbnail(url=ctx.author.avatar_url)
        embed.add_field(name='**INFO**',
                        value=(f'**ATT**: {p.get_att()}\n'
                               f'**HP**: {p.hp}/{p.max_hp}'),
                        inline=False)
        embed.add_field(
            name=f'{p.job.get_name().upper()}, **AP**: {p.free_stat_point}',
            value=(f'**STR**: {p.str}\n'
                   f'**DEX**: {p.dex}\n'
                   f'**INT**: {p.int}\n'
                   f'**LUK**: {p.luk}'),
            inline=False)
        embed.set_footer(
            text='Command to increase you stats: "stat <name> <AP>".')
        await ctx.send(embed=embed)
    else:
        res, msg = manager.plus_stat_point(p, param)
        if res:
            pref.save(p.id)
        await ctx.send(f'**{ctx.author.name}**{msg}')
示例#2
0
文件: bot.py 项目: tarngaina/msd
async def skill(ctx, *, param=None):
    p = player.find(ctx.author.id)
    if param == None:
        if p.job.name.lower() == 'beginner':
            await ctx.send(
                f'Sorry **{ctx.author.name}**, Beginner don\'t have skills.')
            return
        embed = discord.Embed(title=f'**{ctx.author.name}**',
                              description='**SKILL**',
                              color=constant.ColorHex.cyan)
        embed.set_thumbnail(url=ctx.author.avatar_url)
        embed.add_field(
            name=f'{p.job.get_name().upper()}, **SP**: {p.free_skill_point}',
            value=(
                f'{p.job.skills[0].get_name()} Lv.{p.skill_att}\n'
                f'Increase your base attack point by {p.skill_att * 2}.\n'
                f'{p.job.skills[1].get_name()} Lv.{p.skill_stat}\n'
                f'Boost your {p.job.main_stat.upper()} by {p.skill_stat * 5} and {p.job.sub_stat.upper()} by {p.skill_stat * 2}.\n'
                f'{p.job.skills[2].get_name()} Lv.{p.skill_attack}\n'
                f'Land an attack of {100 + p.skill_attack * 2}% damage on your enemy.\n'
                f'{p.job.skills[3].get_name()} Lv.{p.skill_buff}\n'
                f'For next {(p.skill_buff // 30) + 1} turn(s), your next attack deal bonus {p.skill_buff}% damage.\n'
                f'{p.job.skills[4].get_name()} Lv.{p.skill_iframe}\n'  #
                f'Instantly deal {p.skill_iframe}% damage on enemy and become invsible for next {(p.skill_buff // 30) + 1} turn(s).'
            ))
        embed.set_footer(
            text='Command to increase your skills level: "skill <name> <SP>".')
        await ctx.send(embed=embed)
    else:
        res, msg = manager.plus_skill_point(p, param)
        if res:
            pref.save(p.id)
        await ctx.send(f'**{ctx.author.name}**{msg}')
示例#3
0
文件: bot.py 项目: tarngaina/msd
async def advance(ctx, *, param=None):
    if param == None:
        await ctx.send('Use command "advance list" for more information.')
    elif param.startswith('list'):
        page = param[-1]
        if page.isnumeric():
            page = int(page)
        else:
            page = 1
        page_name = 'Explorer'
        embed = discord.Embed(title='**List of jobs:**',
                              description=f'{page_name}',
                              color=constant.ColorHex.red)
        s = ''
        for j in job.jobs:
            if j.name.lower() != 'beginner':
                s += f'{j.get_name()}: {j.main_stat.upper()}; {", ".join(j.weapon_types).upper()}\n'
        embed.add_field(name='Make sure you are beginner and reached lv 10.',
                        value=s)
        embed.set_footer(text='Advance job command: "advance <name>".')
        await ctx.send(embed=embed)
    else:
        p = player.find(ctx.author.id)
        res, msg = manager.advance_job(p, param)
        if res:
            pref.save(p.id)
        await ctx.send(f'**{ctx.author.name}**{msg}')
示例#4
0
文件: bot.py 项目: tarngaina/msd
async def map(ctx, *, param=None):
    p = player.find(ctx.author.id)
    if param == None:
        embed = discord.Embed(title=f'**{ctx.author.name}**',
                              description='**MAP**',
                              color=constant.ColorHex.purple)
        embed.set_thumbnail(url=ctx.author.avatar_url)
        embed.add_field(name=f'You are currently in \n{p.area.get_name()}',
                        value=f'Level recommended: **{p.area.lv}**',
                        inline=False)
        embed.set_footer(text='To see a list of map, use command: "map list".')
        await ctx.send(embed=embed)
    elif param.startswith('list'):
        page = param[-1]
        if page.isnumeric():
            page = int(page)
        else:
            page = 1
        embed = discord.Embed(title='**List of maps:**',
                              description=f'Page {page}',
                              color=constant.ColorHex.purple)
        start = (page - 1) * 5
        end = start + 5
        for i in range(start, end):
            a = area.areas[i]
            embed.add_field(name=f'{a.get_name()}',
                            value=f'Lv.{a.lv}',
                            inline=True)
        embed.set_footer(text='To go certain map: "map <name>".')
        await ctx.send(embed=embed)
    else:
        res, msg = manager.go_area(p, param)
        if res:
            pref.save(p.id)
        await ctx.send(f'**{ctx.author.name}**{msg}')
示例#5
0
文件: bot.py 项目: tarngaina/msd
async def farm(ctx):
    p = player.find(ctx.author.id)
    res, msg = manager.farm(p)
    if res:
        pref.save(p.id)
    await ctx.send(f'**{ctx.author.name}**{msg}')
    if res:
        await event.trigger_event(ctx.channel, ctx.author)
示例#6
0
文件: bot.py 项目: tarngaina/msd
async def sell(ctx, *, param):
    param = param.split(' ')
    id = ' '.join(param)
    num = 1
    if param[-1].isnumeric():
        id = ' '.join(param[:-1])
        num = int(param[-1])
    p = player.find(ctx.author.id)
    res, msg = manager.sell_item(p, id, num)
    if res:
        pref.save(p.id)
    await ctx.send(msg)
示例#7
0
文件: bot.py 项目: tarngaina/msd
async def equip(ctx, *, id):
    p = player.find(ctx.author.id)
    if id == 'info':
        e = ''
        s = (
            f'{ctx.author.mention} equips: \n'
            f'weapon: {p.weapon.get_name() if p.weapon != None else e}\n'
            f'hat: {p.hat.get_name() if p.hat != None else e}\n'
            f'top: {p.top.get_name() if p.top != None else e}\n'
            f'bottom: {p.bottom.get_name() if p.bottom != None else e}\n'
            f'shoe: {p.shoe.get_name() if p.shoe != None else e}\n'
            f'glove: {p.glove.get_name() if p.glove != None else e}\n'
            f'cape: {p.cape.get_name() if p.cape != None else e}\n'
            f'shoulder: {p.shoulder.get_name() if p.shoulder != None else e}\n'
        )
        await ctx.send(s)
    else:
        res, msg = manager.equip_item(p, id)
        if res:
            pref.save(p.id)
        await ctx.send(msg)