예제 #1
0
파일: unit.py 프로젝트: zunaalabaya/TAC-BOT
def LeaderSkill(skill):
    skill = DIRS['Skill'][skill]
    ret = []
    if 'target_buff_iname' in skill:
        buff = StrBuff(skill['target_buff_iname'], 2, 2, False)
        if ':' in buff:
            buff = buff[buff.rindex(': ')+2:].replace('\n', ': ')
        ret.append(buff)
    if 'target_cond_iname' in skill:
        ret.append(StrCondition(skill['target_cond_iname'], 2, 2))
    return '\n'.join(ret)
예제 #2
0
파일: unit.py 프로젝트: zunaalabaya/TAC-BOT
def MasterAbility(ability, dif=False):
    ability = DIRS['Ability'][ability]
    skill = DIRS['Skill'][ability['skills'][0]['iname']]
    ret = []
    if 'target_buff_iname' in skill:
        ret.append(StrBuff(skill['target_buff_iname'], 2, 2, True))
    if 'target_cond_iname' in skill:
        ret.append(StrCondition(skill['target_cond_iname'], 2, 2))
    if 'ReplaceTargetIdLists' in skill:
        ret.append('{skill} Upgrade'.format(
            skill=DIRS['Skill'][skill['ReplaceTargetIdLists'][0]]['name']))
    return '\n'.join(ret) if ret else '*Active Skill*'
예제 #3
0
파일: unit.py 프로젝트: zunaalabaya/TAC-BOT
def job(unit,job):
    job=int(job[3])
    if job < 4:
        job=DIRS['Job'][unit['jobs'][job-1]]
    else:
        job=DIRS['Job'][unit['jobchanges'][job-4]]
        if not job:
            return([])
    
    print((1+(job['ranks'][-1]['status']['PATK']/100)))
    print(TACScale(unit['ini_status']['param']['PATK'],unit['max_status']['param']['PATK'],85,100))
    return ([
        {'name': 'Weapon',          'value':job['weapon'],                              'inline':True},
        {'name': 'AI Role',            'value':job['type'],                                'inline':True},
        {'name': 'DMG-Formula',     'value':job['formula'],                             'inline':False},
        {'name': 'Move',            'value':job['move'],                                'inline':True},
        {'name': 'Jump',            'value':job['jump'],                                'inline':True},
        {'name': 'Avoid',           'value':'{}%'.format(job['ranks'][-1]['avoid']),    'inline':True},
        {'name': 'Initial Jewels',  'value':'{}%'.format(100+job['ranks'][-1]['inimp']),'inline':True},
        {'name': 'Modifiers',        
            'value':', '.join([
                '{}% {}'.format(value,stat)
                for stat,value in job['ranks'][-1]['status'].items()
                if value!=0
                ]),
            'inline':False},
        {'name': 'JM Bonus Stats',        
            'value': StrBuff(DIRS['Skill'][job['master']]['target_buff_iname']),
            'inline':False},
        {'name': 'Stats without JM bonus',        
            'value': '\n'.join([
                '{}: {}'.format(
                    stat,
                    int(value+
                        (
                            (TACScale(unit['ini_status']['param'][stat],unit['max_status']['param'][stat],85,100)*
                            (1+
                            (job['ranks'][-1]['status'][stat]/100))) if stat in unit['max_status']['param'] else 0
                        )
                    )
                    )
                for stat,value in job['stats'].items()
                if 'Res' not in stat
            ]),    
            'inline':True},
        {'name': 'Resistances',        
            'value': '\n'.join([
                '{}: {}'.format(stat,value)
                for stat,value in job['stats'].items()
                if 'Res' in stat
            ]),    
            'inline':True},
        ],job['name'])
예제 #4
0
파일: unit.py 프로젝트: zunaalabaya/TAC-BOT
def kaigan(unit):
    if 'kaigan' in unit:
        f=[]
        for typ,kaigan in unit['kaigan'].items():
            if kaigan=='Unlock':
                continue
            text=''
            if 'mSkillIname' in kaigan:
                skill = DIRS['Skill'][kaigan['mSkillIname']]
                if 'target_buff_iname' in skill:
                    text+='\n**Buff:**\n' + StrBuff(skill['target_buff_iname'],2,2,True)
                if 'target_cond_iname' in skill:
                    text+='\n**Condition:**\n' + StrCondition(skill['target_cond_iname'],2,2)
            if 'mOverwriteLeaderSkillIname' in kaigan:
                text+='\n**Leader Skill:**\n' + LeaderSkill(kaigan['mOverwriteLeaderSkillIname'])
            if 'mLearnAbilities' in kaigan and len(kaigan['mLearnAbilities']):
                pass
            f.append({'name':typ, 'value':text[1:], 'inline':False})
        return f
    else:
        return 0
예제 #5
0
def main(job):
    return [
        {
            'name': 'Weapon',
            'value': job['weapon'],
            'inline': True
        },
        {
            'name': 'AI Role',
            'value': job['type'],
            'inline': True
        },
        {
            'name': 'DMG-Formula',
            'value': job['formula'],
            'inline': False
        },
        {
            'name': 'Move',
            'value': job['move'],
            'inline': True
        },
        {
            'name': 'Jump',
            'value': job['jump'],
            'inline': True
        },
        {
            'name': 'Avoid',
            'value': '{}%'.format(job['ranks'][-1]['avoid']),
            'inline': True
        },
        {
            'name': 'Initial Jewels',
            'value': '{}%'.format(100 + job['ranks'][-1]['inimp']),
            'inline': True
        },
        {
            'name':
            'Modifiers',
            'value':
            ', '.join([
                '{}% {}'.format(value, stat)
                for stat, value in job['ranks'][-1]['status'].items()
                if value != 0
            ]),
            'inline':
            False
        },
        {
            'name': 'JM Bonus Stats',
            'value':
            StrBuff(DIRS['Skill'][job['master']]['target_buff_iname']),
            'inline': False
        },
        {
            'name':
            'Stats',
            'value':
            '\n'.join([
                '{}: {}'.format(stat, value)
                for stat, value in job['stats'].items() if 'Res' not in stat
            ]),
            'inline':
            True
        },
        {
            'name':
            'Resistances',
            'value':
            '\n'.join([
                '{}: {}'.format(stat, value)
                for stat, value in job['stats'].items() if 'Res' in stat
            ]),
            'inline':
            True
        },
    ]
예제 #6
0
def main(card):
    try:
        unit = DIRS['Unit']['UN_V2_' + card['iname'].rsplit('_', 2)[1]]['name']
    except:
        unit = 'None'

    fields = [
        {
            'name': 'Unit',
            'value': unit,
            'inline': True
        },
        {
            'name': 'Rarity',
            'value': Rarity(card['rare'], 4),
            'inline': True
        },
        {
            'name': 'Enhance Cost',
            'value': str(card['en_cost']),
            'inline': True
        },
        {
            'name': 'Enhance EXP',
            'value': str(card['en_exp']),
            'inline': True
        },
    ]
    #Weapon Type ~ Tag
    if 'trust_reward' in card:
        fields.append({
            'name': 'Trust Reward',
            'value': card['trust_reward'],
            'inline': False
        })

    #effects
    for i, effect in enumerate(card['effects']):
        value = []
        #cnds_iname
        if 'cnds_iname' in effect:
            value.append('__**Condition(s):**__\n' +
                         CardConditions(effect['cnds_iname']))
        #abil_iname
        if 'abil_iname' in effect:
            value.append('__**Vision Ability:**__\n' +
                         DIRS['Ability'][effect['abil_iname']]['name'])
        #skin
        if 'skin' in effect:
            value.append('__**Skin:**__\n' +
                         DIRS['Artifact'][effect['skin']]['name'])
        #statusup_skill
        if 'statusup_skill' in effect:
            value.append('__**Stats:**__\n' + StrBuff(
                DIRS['Skill'][effect['statusup_skill']]['target_buff_iname'],
                2, 2))
        #card_skill
        if 'card_skill' in effect:
            value.append('__**Stats:**__\n' + StrBuff(
                DIRS['Skill'][effect['card_skill']]['target_buff_iname'], 2, 2)
                         )
        #add_card_skill_buff_awake
        if 'add_card_skill_buff_awake' in effect:
            value.append('__**Limit Break Stats:**__\n' +
                         StrBuff(effect['add_card_skill_buff_awake'], 2, 2))
        #add_card_skill_buff_lvmax
        if 'add_card_skill_buff_lvmax' in effect:
            value.append('__**Max Limit Break Stats:**__\n' +
                         StrBuff(effect['add_card_skill_buff_lvmax'], 2, 2))
        fields.append({
            'name': 'Effect ' + str(i + 1),
            'value': '\n'.join(value),
            'inline': False
        })
    #lore
    fields.append({
        'name': 'Description',
        'value': card['expr'],
        'inline': False
    })
    return fields
예제 #7
0
def main(gear):
    fields = []

    #Weapon Type ~ Tag
    fields.append({'name': 'Type', 'value': gear['tag'], 'inline': False})

    #Stats
    stats = [
        "{grade}★: {stats}".format(
            grade=grade + 1,
            stats=StrBuff(
                DIRS['Skill'][gear['equip_effects'][grade]]
                ['target_buff_iname'], grade * 5 + 9, 29))
        for grade in range(gear['rareini'], gear['raremax'] + 1)
    ]
    fields.append({
        'name': 'Max Stats',
        'value': '\n'.join(stats),
        'inline': False
    })

    #On Attack De/Buff
    target = {
        'Self': 'Self',
        'SelfSide': 'Ally',
        'EnemySide': 'Enemy',
        'NotSelf': 'Target'
    }

    on_attack = []
    for grade in range(gear['rareini'], gear['raremax'] + 1):
        skill = DIRS['Skill'][gear['attack_effects'][grade]]
        effects = []
        if 'self_buff_iname' in skill:
            effects.append('Self: ' +
                           StrBuff(skill['self_buff_iname'], grade * 5 +
                                   9, 29, False))
        if 'target_buff_iname' in skill:
            effects.append('Target: ' +
                           StrBuff(skill['target_buff_iname'], grade * 5 +
                                   9, 29, False))
        if 'self_cond_iname' in skill:
            effects.append('Self: ' +
                           StrCondition(skill['self_cond_iname'], grade * 5 +
                                        9, 29))
        if 'target_cond_iname' in skill:
            effects.append('Target: ' +
                           StrCondition(skill['target_cond_iname'], grade * 5 +
                                        9, 29))

        on_attack.append("{grade}★: {effect}".format(
            grade=grade + 1, effect='\n\t'.join(effects)))

    fields.append({
        'name': 'Max Attack (De)Buff',
        'value': '\n'.join(on_attack),
        'inline': False
    })

    #weapon abilities
    abilities = []
    for abil in gear['abil_inames']:
        ability = DIRS['Ability'][abil]
        conditions = ''
        if 'condition_units' in ability:
            conditions += ', '.join([
                DIRS['Unit'][unit]['name']
                for unit in ability['condition_units']
            ])
        if 'condition_jobs' in ability:
            conditions += 'Job: ' + DIRS['Job'][ability['condition_jobs']
                                                [0]]['name']
        elif 'condition_sex' in ability:
            conditions += ability['condition_sex']

        abilities.append(conditions + ': ' + ability['name'])
    fields.append({
        'name': 'Ability',
        'value': "\n\n".join(abilities),
        'inline': False
    })

    #lore
    fields.append({
        'name': 'Flavor Text',
        'value': gear['flavor'],
        'inline': False
    })
    return fields