Ejemplo n.º 1
0
 def process_result(self, res, exclude_falsy=True, full_query=True):
     if not full_query:
         return res
     if res.get('_WeaponSeriesId'):
         res['_WeaponSeriesId'] = self.index['WeaponBodyGroupSeries'].get(
             res['_WeaponSeriesId'], exclude_falsy=exclude_falsy)
     if res.get('_WeaponType'):
         res['_WeaponType'] = WEAPON_TYPES.get(res['_WeaponType'],
                                               res['_WeaponType'])
     if res.get('_ElementalType'):
         res['_ElementalType'] = ELEMENTS.get(res['_ElementalType'],
                                              res['_ElementalType'])
     skill_ids = {0}
     for i in (3, 2, 1):
         key = f'_ChangeSkillId{i}'
         if key in res and res[key] not in skill_ids:
             skill_ids.add(res[key])
             res[key] = self.index['SkillData'].get(
                 res[key], exclude_falsy=exclude_falsy, full_abilities=True)
     ab_ids = {0}
     for i in (1, 2):
         for j in range(3, 2, 1):
             key = f'_Abilities{i}{j}'
             if key in res and res[key] not in ab_ids:
                 ab_ids.add(res[key])
                 res[key] = self.index['AbilityData'].get(
                     res[key], full_query=True, exclude_falsy=exclude_falsy)
     for skin in WeaponBody.WEAPON_SKINS:
         if res.get(skin):
             res[skin] = self.index['WeaponSkin'].get(
                 res[skin], exclude_falsy=exclude_falsy)
     return res
Ejemplo n.º 2
0
    def process_result(self, res, exclude_falsy=True, condense=True):
        self.index['ActionParts'].animation_reference = ('CharacterMotion', int(f'{res["_BaseId"]:06}{res["_VariationId"]:02}'))
        if '_WeaponType' in res:
            res['_WeaponType'] = WEAPON_TYPES.get(res['_WeaponType'], res['_WeaponType'])
        if '_ElementalType' in res:
            res['_ElementalType'] = ELEMENTS.get(res['_ElementalType'], res['_ElementalType'])
        if '_CharaType' in res:
            res['_CharaType'] = CLASS_TYPES.get(res['_CharaType'], res['_CharaType'])
        if condense:
            res = self.condense_stats(res)
        
        if '_ModeChangeType' in res and res['_ModeChangeType']:
            res['_ModeChangeType'] = MODE_CHANGE_TYPES.get(res['_ModeChangeType'], res['_ModeChangeType'])
        for m in ('_ModeId1', '_ModeId2', '_ModeId3'):
            if m in res:
                res[m] = self.index['CharaModeData'].get(res[m], exclude_falsy=exclude_falsy, full_query=True)

        for s in ('_Skill1', '_Skill2'):
            if s in res and res[s]:
                res[s] = self.index['SkillData'].get(res[s], exclude_falsy=exclude_falsy, full_query=True)

        if condense:
            res = self.last_abilities(res)
        else:
            res = self.all_abilities(res)
        
        if '_BurstAttack' in res and res['_BurstAttack'] and (ba := self.index['PlayerAction'].get(res['_BurstAttack'], exclude_falsy=exclude_falsy)):
            res['_BurstAttack'] = ba
Ejemplo n.º 3
0
    def process_result(self, res, condense=True):
        self.set_animation_reference(res)
        if "_WeaponType" in res:
            res["_WeaponType"] = WEAPON_TYPES.get(res["_WeaponType"], res["_WeaponType"])
        if "_ElementalType" in res:
            res["_ElementalType"] = ELEMENTS.get(res["_ElementalType"], res["_ElementalType"])
        if "_CharaType" in res:
            res["_CharaType"] = CLASS_TYPES.get(res["_CharaType"], res["_CharaType"])
        if condense:
            res = self.condense_stats(res)

        if "_ModeChangeType" in res and res["_ModeChangeType"]:
            res["_ModeChangeType"] = MODE_CHANGE_TYPES.get(res["_ModeChangeType"], res["_ModeChangeType"])
        for m in ("_ModeId1", "_ModeId2", "_ModeId3", "_ModeId4"):
            if m in res and (mode := self.index["CharaModeData"].get(res[m], full_query=True)):
                res[m] = mode
Ejemplo n.º 4
0
 def process_result(self, res, exclude_falsy=True, full_query=True):
     if not full_query:
         return res
     if '_Type' in res:
         res['_Type'] = WEAPON_TYPES.get(res['_Type'], res['_Type'])
     if '_ElementalType' in res:
         res['_ElementalType'] = ELEMENTS.get(res['_ElementalType'],
                                              res['_ElementalType'])
     if '_Skill' in res:
         res['_Skill'] = self.index['SkillData'].get(
             res['_Skill'],
             exclude_falsy=exclude_falsy,
             full_abilities=True)
     for k in ('_Abilities11', '_Abilities21'):
         if k in res and res[k]:
             res[k] = self.index['AbilityData'].get(
                 res[k], full_query=True, exclude_falsy=exclude_falsy)
     return res
Ejemplo n.º 5
0
    def process_result(self, res, exclude_falsy=True, condense=True):
        self.index['ActionParts'].animation_reference = (
            'CharacterMotion',
            int(f'{res["_BaseId"]:06}{res["_VariationId"]:02}'))
        if '_WeaponType' in res:
            res['_WeaponType'] = WEAPON_TYPES.get(res['_WeaponType'],
                                                  res['_WeaponType'])
        if '_ElementalType' in res:
            res['_ElementalType'] = ELEMENTS.get(res['_ElementalType'],
                                                 res['_ElementalType'])
        if '_CharaType' in res:
            res['_CharaType'] = CLASS_TYPES.get(res['_CharaType'],
                                                res['_CharaType'])
        if condense:
            res = self.condense_stats(res)

        if '_ModeChangeType' in res and res['_ModeChangeType']:
            res['_ModeChangeType'] = MODE_CHANGE_TYPES.get(
                res['_ModeChangeType'], res['_ModeChangeType'])
        for m in ('_ModeId1', '_ModeId2', '_ModeId3', '_ModeId4'):
            if m in res and (mode := self.index['CharaModeData'].get(
                    res[m], exclude_falsy=exclude_falsy, full_query=True)):
                res[m] = mode
Ejemplo n.º 6
0
    def process_result(self, res, exclude_falsy=True, condense=True):
        if '_WeaponType' in res:
            res['_WeaponType'] = WEAPON_TYPES.get(res['_WeaponType'],
                                                  res['_WeaponType'])
        if '_ElementalType' in res:
            res['_ElementalType'] = ELEMENTS.get(res['_ElementalType'],
                                                 res['_ElementalType'])
        if '_CharaType' in res:
            res['_CharaType'] = CLASS_TYPES.get(res['_CharaType'],
                                                res['_CharaType'])
        if condense:
            res = self.condense_stats(res)

        if '_ModeChangeType' in res and res['_ModeChangeType']:
            res['_ModeChangeType'] = MODE_CHANGE_TYPES.get(
                res['_ModeChangeType'], res['_ModeChangeType'])
        for m in ('_ModeId1', '_ModeId2', '_ModeId3'):
            if m in res:
                res[m] = self.mode.get(res[m],
                                       exclude_falsy=exclude_falsy,
                                       full_query=True)

        for s in ('_Skill1', '_Skill2'):
            if s in res and res[s]:
                res[s] = self.skills.get(res[s],
                                         exclude_falsy=exclude_falsy,
                                         full_query=True,
                                         full_hitattr=not condense)

        if condense:
            res = self.last_abilities(res)
        else:
            res = self.all_abilities(res)
        chara_id = f'{res["_BaseId"]}{res["_VariationId"]:02}'
        res['_Animations'] = self.motions.get(chara_id, by='ref')

        return res
Ejemplo n.º 7
0
 def process_result(self, res, full_query=True):
     if not full_query:
         return res
     self.set_animation_reference(res)
     self.link(res, "_WeaponSeriesId", "WeaponBodyGroupSeries")
     if res.get("_WeaponPassiveAbilityGroupId"):
         res["_WeaponPassiveAbilityGroupId"] = self.index[
             "WeaponPassiveAbility"].get(
                 res["_WeaponPassiveAbilityGroupId"],
                 by="_WeaponPassiveAbilityGroupId")
     if res.get("_WeaponType"):
         res["_WeaponType"] = WEAPON_TYPES.get(res["_WeaponType"],
                                               res["_WeaponType"])
     if res.get("_ElementalType"):
         res["_ElementalType"] = ELEMENTS.get(res["_ElementalType"],
                                              res["_ElementalType"])
     skill_ids = {0}
     for i in (3, 2, 1):
         key = f"_ChangeSkillId{i}"
         if key in res and res[key] not in skill_ids:
             skill_ids.add(res[key])
             res[key] = self.index["SkillData"].get(res[key],
                                                    full_abilities=True)
     ab_ids = {0}
     for i in (1, 2, 3):
         for j in (3, 2, 1):
             key = f"_Abilities{i}{j}"
             if key in res and res[key] not in ab_ids:
                 ab_ids.add(res[key])
                 res[key] = self.index["AbilityData"].get(res[key],
                                                          full_query=True)
     for skin in WeaponBody.WEAPON_SKINS:
         if res.get(skin):
             res[skin] = self.index["WeaponSkin"].get(res[skin])
     self.index["ActionParts"].animation_reference = None
     return res
Ejemplo n.º 8
0
def count_fort_passives(include_album=True):
    dbm = DBManager()
    adv_ele_passives = {(idx, ele): [0, 0] for idx, ele in ELEMENTS.items()}
    if include_album:
        for mlb, factor in ALBUM_BONUS_ADV.items():
            for res in dbm.query_many(COUNT_ADV_BY_MAX_LIMIT_BREAK, (mlb, ),
                                      dict):
                try:
                    eletype = res["_ElementalType"]
                    elename = ELEMENTS[eletype]
                except KeyError:
                    continue
                adv_ele_passives[(eletype, elename)][0] += round(
                    res["_Count"] * factor, 1)
                adv_ele_passives[(eletype, elename)][1] += round(
                    res["_Count"] * factor, 1)

    adv_wep_passives = {(idx, wep): [0, 0]
                        for idx, wep in WEAPON_TYPES.items()}
    for res in dbm.query_many(COUNT_WEAPON_BONUS, tuple(), dict):
        try:
            weptype = res["_WeaponType"]
            wepname = WEAPON_TYPES[weptype]
        except KeyError:
            continue
        adv_wep_passives[(weptype, wepname)][0] += res["_Bonus"]
        adv_wep_passives[(weptype, wepname)][1] += res["_Bonus"]

    drg_passives = {(idx, ele): [0, 0] for idx, ele in ELEMENTS.items()}
    if include_album:
        for mlb, factor in ALBUM_BONUS_DRG.items():
            for res in dbm.query_many(COUNT_DRG_BY_MAX_LIMIT_BREAK, (mlb, ),
                                      dict):
                try:
                    eletype = res["_ElementalType"]
                    elename = ELEMENTS[eletype]
                except KeyError:
                    continue
                drg_passives[(eletype, elename)][0] += round(
                    res["_Count"] * factor["hp"], 1)
                drg_passives[(eletype, elename)][1] += round(
                    res["_Count"] * factor["atk"], 1)

    for res in dbm.query_many(COUNT_HALIDOM, (), dict):
        if res["_EffectId"] == 1:
            passive_dict = adv_wep_passives
            passive_types = WEAPON_TYPES
        elif res["_EffectId"] == 2:
            passive_dict = adv_ele_passives
            passive_types = ELEMENTS
        elif res["_EffectId"] == 6:
            passive_dict = drg_passives
            passive_types = ELEMENTS
        mult = 1
        if "Altar" in res["_Name"] or "Dojo" in res["_Name"]:
            mult = 2
        for eff in (res["_EffType1"], res["_EffType2"]):
            if not eff:
                continue
            passive_dict[(eff,
                          passive_types[eff])][0] += res["_EffArgs1"] * mult
            passive_dict[(eff,
                          passive_types[eff])][1] += res["_EffArgs2"] * mult

    return adv_ele_passives, adv_wep_passives, drg_passives
Ejemplo n.º 9
0
class AbilityData(DBView):
    STAT_ABILITIES = {
        1: 'hp',
        2: 'strength',
        3: 'defense',
        4: 'skill haste',
        5: 'dragon haste',
        8: 'shapeshift time',
        10: 'attack speed',
        12: 'fs charge rate'
    }

    @staticmethod
    def a_ids(res, i):
        a_ids = [
            res[f'_VariousId{i}{a}'] for a in ('a', 'b', 'c', '')
            if f'_VariousId{i}{a}' in res and res[f'_VariousId{i}{a}']
        ]
        return a_ids

    @staticmethod
    def a_str(res, i):
        return res.get(f'_VariousId{i}str', None)

    @staticmethod
    def generic_description(name):
        def f(ad, res, i):
            a_ids = AbilityData.a_ids(res, i)
            a_str = AbilityData.a_str(res, i)
            if a_ids or a_str:
                res[f'_Description{i}'] = f'{name} {a_ids, a_str}'
            else:
                res[f'_Description{i}'] = name
            return res

        return f

    @staticmethod
    def link_various_ids(ad, res, i, view='ActionCondition'):
        a_ids = []
        for a in ('a', 'b', 'c', ''):
            key = f'_VariousId{i}{a}'
            if key in res and res[key]:
                a_ids.append(res[key])
                res[key] = ad.index[view].get(res[key], exclude_falsy=True)
        return res, a_ids

    @staticmethod
    def link_various_str(ad, res, i, view='PlayerActionHitAttribute'):
        a_str = None
        key = f'_VariousId{i}str'
        if key in res and res[key]:
            a_str = res[key]
            res[key] = ad.index[view].get(res[key],
                                          by='_Id',
                                          exclude_falsy=True)
        return res, a_str

    @staticmethod
    def stat_ability(ad, res, i):
        a_id = AbilityData.a_ids(res, i)[0]
        res[f'_Description{i}'] = f'stat {AbilityData.STAT_ABILITIES.get(a_id, a_id)}'
        return res

    @staticmethod
    def affliction_resist(ad, res, i):
        a_id = AbilityData.a_ids(res, i)[0]
        res[f'_Description{i}'] = f'affliction resist {AFFLICTION_TYPES.get(a_id, a_id)}'
        return res

    @staticmethod
    def affliction_proc_rate(ad, res, i):
        a_id = AbilityData.a_ids(res, i)[0]
        res[f'_Description{i}'] = f'affliction proc rate {AFFLICTION_TYPES.get(a_id, a_id)}'
        return res

    @staticmethod
    def tribe_resist(ad, res, i):
        a_id = AbilityData.a_ids(res, i)[0]
        res[f'_Description{i}'] = f'tribe resist {TRIBE_TYPES.get(a_id, a_id)}'
        return res

    @staticmethod
    def tribe_bane(ad, res, i):
        a_id = AbilityData.a_ids(res, i)[0]
        res[f'_Description{i}'] = f'tribe bane {TRIBE_TYPES.get(a_id, a_id)}'
        return res

    @staticmethod
    def action_condition(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad, res, i)
        res, a_str = AbilityData.link_various_str(ad, res, i)
        res[f'_Description{i}'] = f'action condition {a_ids, a_str}'
        return res

    @staticmethod
    def affliction_punisher(ad, res, i):
        a_id = AbilityData.a_ids(res, i)[0]
        res[f'_Description{i}'] = f'affliction punisher {AFFLICTION_TYPES.get(a_id, a_id)}'
        return res

    @staticmethod
    def conditional_action_grant(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad,
                                                  res,
                                                  i,
                                                  view='ActionGrant')
        res[f'_Description{i}'] = f'conditional action grant {a_ids}'
        return res

    @staticmethod
    def elemental_resist(ad, res, i):
        a_id = AbilityData.a_ids(res, i)[0]
        res[f'_Description{i}'] = f'elemental resist {ELEMENTS.get(a_id, a_id)}'
        return res

    @staticmethod
    def action_grant(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad,
                                                  res,
                                                  i,
                                                  view='ActionGrant')
        res[f'_Description{i}'] = f'action grant {a_ids}'
        return res

    @staticmethod
    def ability_reference(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad,
                                                  res,
                                                  i,
                                                  view='AbilityData')
        res[f'_Description{i}'] = f'ability reference {a_ids}'
        return res

    @staticmethod
    def skill_reference(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad, res, i, view='SkillData')
        res[f'_Description{i}'] = f'skill reference {a_ids}'
        return res

    @staticmethod
    def action_reference(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad,
                                                  res,
                                                  i,
                                                  view='PlayerAction')
        res[f'_Description{i}'] = f'action reference {a_ids}'
        return res

    @staticmethod
    def random_action_condition(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad, res, i)
        res, a_str = AbilityData.link_various_str(ad, res, i)
        res[f'_Description{i}'] = f'random action condition {a_ids, a_str}'
        return res

    @staticmethod
    def elemental_damage(ad, res, i):
        a_id = AbilityData.a_ids(res, i)[0]
        res[f'_Description{i}'] = f'elemental damage {ELEMENTS.get(a_id, a_id)}'
        return res

    @staticmethod
    def action_condition_timer(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad, res, i)
        res[f'_Description{i}'] = 'action condition timer'
        return res

    def __init__(self, index):
        super().__init__(index,
                         'AbilityData',
                         labeled_fields=['_Name', '_Details', '_HeadText'])

    def process_result(self, res, full_query=True, exclude_falsy=True):
        try:
            res['_ConditionType'] = ABILITY_CONDITION_TYPES.get(
                res['_ConditionType'], res['_ConditionType'])
        except:
            pass
        try:
            res[f'_TargetAction'] = TARGET_ACTION_TYPES[res[f'_TargetAction']]
        except:
            pass
        for i in (1, 2, 3):
            try:
                res[f'_TargetAction{i}'] = TARGET_ACTION_TYPES[
                    res[f'_TargetAction{i}']]
            except:
                pass
            try:
                res = ABILITY_TYPES[res[f'_AbilityType{i}']](self, res, i)
            except KeyError:
                pass
        if (ele := res.get('_ElementalType')):
            res['_ElementalType'] = ELEMENTS.get(ele, ele)
        if (wep := res.get('_WeaponType')):
            res['_WeaponType'] = WEAPON_TYPES.get(wep, wep)
Ejemplo n.º 10
0
class AbilityData(DBView):
    STAT_ABILITIES = {
        1: "hp",
        2: "strength",
        3: "defense",
        4: "skill haste",
        5: "dragon haste",
        8: "shapeshift time",
        10: "attack speed",
        12: "fs charge rate",
    }
    MAP_COND_VALUE = (
        AbilityCondition.BUFFED_SPECIFIC_ID,
        AbilityCondition.BUFF_DISAPPEARED,
        AbilityCondition.BUFF_CONSUMED,
    )
    MAP_COND_VALUE2 = (
        AbilityCondition.BUFFED_SPECIFIC_ID_COUNT,
        AbilityCondition.BUFF_COUNT_MORE_THAN,
    )

    @staticmethod
    def a_ids(res, i):
        a_ids = [
            res[f"_VariousId{i}{a}"] for a in ("a", "b", "c", "")
            if f"_VariousId{i}{a}" in res and res[f"_VariousId{i}{a}"]
        ]
        return a_ids

    @staticmethod
    def a_str(res, i):
        return res.get(f"_VariousId{i}str", None)

    @staticmethod
    def first_a_id(res, i):
        try:
            key = f"_VariousId{i}a"
            return key, res[key]
        except KeyError:
            key = f"_VariousId{i}"
            return key, res[key]

    @staticmethod
    def generic_description(name):
        def f(ad, res, i):
            a_ids = AbilityData.a_ids(res, i)
            a_str = AbilityData.a_str(res, i)
            if a_ids or a_str:
                res[f"_Description{i}"] = f"{name} {a_ids, a_str}"
            else:
                res[f"_Description{i}"] = name
            return res

        return f

    @staticmethod
    def link_various_ids(ad, res, i, view="ActionCondition"):
        a_ids = []
        for a in ("a", "b", "c", ""):
            key = f"_VariousId{i}{a}"
            if key in res and res[key]:
                a_ids.append(res[key])
                res[key] = ad.index[view].get(res[key])
        return res, a_ids

    @staticmethod
    def link_various_str(ad, res, i, view="PlayerActionHitAttribute"):
        a_str = None
        key = f"_VariousId{i}str"
        if key in res and res[key]:
            a_str = res[key]
            res[key] = ad.index[view].get(res[key], by="_Id")
        return res, a_str

    @staticmethod
    def stat_ability(ad, res, i):
        key, value = AbilityData.first_a_id(res, i)
        res[key] = AbilityStat(value)
        return res

    @staticmethod
    def affliction_ability(ad, res, i):
        key, value = AbilityData.first_a_id(res, i)
        res[key] = AFFLICTION_TYPES.get(value, value)
        return res

    @staticmethod
    def tribe_ability(ad, res, i):
        key, value = AbilityData.first_a_id(res, i)
        res[key] = TRIBE_TYPES.get(value, value)
        return res

    @staticmethod
    def action_condition(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad, res, i)
        res, a_str = AbilityData.link_various_str(ad, res, i)
        # res[f"_Description{i}"] = f"action condition {a_ids, a_str}"
        return res

    @staticmethod
    def conditional_action_grant(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad,
                                                  res,
                                                  i,
                                                  view="ActionGrant")
        # res[f"_Description{i}"] = f"conditional action grant {a_ids}"
        return res

    @staticmethod
    def elemental_ability(ad, res, i):
        key, value = AbilityData.first_a_id(res, i)
        res[key] = ELEMENTS.get(value, value)
        return res

    @staticmethod
    def action_grant(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad,
                                                  res,
                                                  i,
                                                  view="ActionGrant")
        # res[f"_Description{i}"] = f"action grant {a_ids}"
        return res

    @staticmethod
    def ability_reference(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad,
                                                  res,
                                                  i,
                                                  view="AbilityData")
        # res[f"_Description{i}"] = f"ability reference {a_ids}"
        return res

    @staticmethod
    def skill_reference(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad, res, i, view="SkillData")
        # res[f"_Description{i}"] = f"skill reference {a_ids}"
        return res

    @staticmethod
    def action_reference(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad,
                                                  res,
                                                  i,
                                                  view="PlayerAction")
        # res[f"_Description{i}"] = f"action reference {a_ids}"
        return res

    @staticmethod
    def action_condition_timer(ad, res, i):
        res, a_ids = AbilityData.link_various_ids(ad, res, i)
        res[f"_Description{i}"] = "action condition timer"
        return res

    def __init__(self, index):
        super().__init__(index,
                         "AbilityData",
                         labeled_fields=["_Name", "_Details", "_HeadText"])

    def process_result(self, res):
        try:
            ac_enum = AbilityCondition(res["_ConditionType"])
            if ac_enum in AbilityData.MAP_COND_VALUE:
                self.link(
                    res,
                    "_ConditionValue",
                    "ActionCondition",
                )
            if ac_enum in AbilityData.MAP_COND_VALUE2:
                self.link(
                    res,
                    "_ConditionValue2",
                    "ActionCondition",
                )
            res["_ConditionType"] = ac_enum
        except (KeyError, ValueError):
            pass
        try:
            res["_TargetAction"] = AbilityTargetAction(res["_TargetAction"])
        except (KeyError, ValueError):
            pass
        self.link(res, "_RequiredBuff", "ActionCondition")
        for i in (1, 2, 3):
            try:
                res[f"_TargetAction{i}"] = AbilityTargetAction(
                    res[f"_TargetAction{i}"])
            except (KeyError, ValueError):
                pass
            try:
                res[f"_AbilityType{i}"] = AbilityType(res[f"_AbilityType{i}"])
            except (KeyError, ValueError):
                pass
            try:
                res = ABILITY_TYPES[res[f"_AbilityType{i}"]](self, res, i)
            except (KeyError, IndexError):
                pass

        if ele := res.get("_ElementalType"):
            res["_ElementalType"] = ELEMENTS.get(ele, ele)
        if wep := res.get("_WeaponType"):
            res["_WeaponType"] = WEAPON_TYPES.get(wep, wep)