Example #1
0
def combine_equip():
    advequip = load_all_equip_json()
    sorted_outputs = {
        '60': [],
        '120': [],
        '180': []
    }

    for adv, equip in advequip.items():
        for duration, equip_d in equip.items():
            pref = equip_d.get('pref', 'base')
            for kind, entry in equip_d.items():
                if kind == 'pref':
                    continue
                if not validate(entry):
                    print('Skipping', adv, kind)
                    continue
                output = entry['output']
                if kind != pref and entry.get('tdps'):
                    tdps = entry.get('tdps')
                    output = output.replace(f'-,{duration},_', f'-,{duration},{tdps}')
                sorted_outputs[duration].append(output)

    for duration, outputs in sorted_outputs.items():
        dst = os.path.join(OUTPUT_DIR, f'{duration}.csv')
        with open(dst, 'w') as f:
            for out in outputs:
                f.write(out)
Example #2
0
def find_offele_backline():
    secondary = {'Axe2': ('flame', 'wind'), 'Dagger2': ('flame', 'water')}
    advequip = load_all_equip_json()
    offele = defaultdict(lambda: [])
    for adv, allequip in advequip.items():
        element = load_adv_json(adv)['c']['ele']
        for duration, keyequip in allequip.items():
            for key, conf in keyequip.items():
                try:
                    for coab in conf['coabs']:
                        try:
                            coab_element = load_adv_json(coab)['c']['ele']
                            if coab_element != element:
                                offele[coab].append(
                                    (adv, element, duration, key, coab))
                        except:
                            if coab in secondary and element not in secondary[
                                    coab]:
                                offele[coab].append(
                                    (adv, element, duration, key, coab))
                except TypeError:
                    continue
    pprint(dict(offele), width=200)
Example #3
0
                    acat = name.split('_')[0]
                else:
                    acat = name
                try:
                    self.abilities[f'{kind}_{aidx}_{name}'] = (
                        kind, ability_dict[acat](*ab))
                except:
                    pass

        for name, val in self.abilities.items():
            kind, abi = val
            abi.oninit(adv, kind)
            self.abilities[name] = abi


if __name__ == '__main__':
    from conf import get_adv, load_all_equip_json
    # amulet_qual = [
    #     'The_Wyrmclan_Duo',
    #     'Flash_of_Genius',
    #     'Moonlight_Party',
    #     'The_Plaguebringer',
    #     'His_Clever_Brother'
    # ]
    for adv, equip in load_all_equip_json().items():
        conf = get_adv(adv)
        pref = equip['180']['pref']
        a_qual = equip['180'][pref]['slots.a']
        slots = Slots(adv, conf.c)
        slots.set_a(keys=a_qual)