Esempio n. 1
0
def convert_egg_values(item: PrimalItem) -> Dict[str, Any]:
    v = dict()

    dino_class = item.get('EggDinoClassToSpawn', 0, None)
    if dino_class:
        v['dinoClass'] = dino_class
        v['temperature'] = (item.EggMinTemperature[0], item.EggMaxTemperature[0])

    hud_mic_ref = item.get('ItemIconMaterialParent', 0, None)
    if hud_mic_ref:
        hud_mic = item.get_source().asset.loader.load_related(hud_mic_ref)
        hud_mic = hud_mic.default_export
        hud_colors = gather_hud_color_data(hud_mic)
        if hud_colors:
            v['hudColorisation'] = hud_colors

    return v
Esempio n. 2
0
def convert_egg_values(item: PrimalItem) -> Dict[str, Any]:
    v = dict()

    dino_class = item.get('EggDinoClassToSpawn', 0, None)
    if dino_class:
        v['dinoClass'] = dino_class
        v['temperature'] = (item.EggMinTemperature[0], item.EggMaxTemperature[0])

    hud_mic_ref = item.get('ItemIconMaterialParent', 0, None)
    if hud_mic_ref and hud_mic_ref.value and hud_mic_ref.value.value:
        try:
            hud_mic = item.get_source().asset.loader.load_related(hud_mic_ref)
            hud_mic = hud_mic.default_export
            hud_colors = gather_hud_color_data(hud_mic)
            if hud_colors:
                v['hudColorisation'] = hud_colors
        except AssetLoadException:
            logger.warning(f'Failure while gathering color data from {hud_mic_ref.value.value.fullname}', exc_info=True)

    return v
Esempio n. 3
0
def gather_item_stat(item: PrimalItem, index: Stat) -> Dict[str, Any]:
    leaf_export = item.get_source()
    ark_index = index.value
    return gather_inherited_struct_fields(leaf_export, 'ItemStatInfos', DEFAULTS, ark_index)