Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.24 update #170

Merged
merged 2 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions PyPoE/cli/exporter/wiki/parsers/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def gemshade_constants_from_hex(hex_text: str):
return GemShadeConstants(*struct.unpack("<ffff", buf))


def _apply_column_map(infobox, column_map, list_object):
def _apply_column_map(infobox, column_map: tuple[tuple[str, dict], ...], list_object):
for k, data in column_map:
value = list_object[k]
if data.get("condition") and not data["condition"](value):
Expand All @@ -97,8 +97,8 @@ def _apply_column_map(infobox, column_map, list_object):


def _type_factory(
data_file,
data_mapping,
data_file: str,
data_mapping: tuple[tuple[str, dict], ...],
row_index=True,
function=None,
fail_condition=False,
Expand Down Expand Up @@ -480,6 +480,7 @@ class ItemsParser(SkillParserShared):
"Crucible": "3.21.0",
"Ancestral": "3.22.0", # AKA Trial of the Ancestors
"Azmeri": "3.23.0", # AKA Affliction
"Necropolis": "3.24.0",
}

_IGNORE_DROP_LEVEL_CLASSES = (
Expand Down Expand Up @@ -2836,7 +2837,7 @@ def _map_fragment_extra(self, infobox, base_item_type, map_fragment_mods):

_type_map_fragment_mods = _type_factory(
data_file="MapFragmentMods.dat64",
data_mapping={},
data_mapping=(),
row_index=True,
function=_map_fragment_extra,
fail_condition=True,
Expand Down Expand Up @@ -2927,16 +2928,11 @@ def add_line(text, mod):
data_file="Essences.dat64",
data_mapping=(
(
"DropLevelMinimum",
"DropLevel",
{
"template": "drop_level",
},
),
(
"DropLevelMaximum",
{
"template": "drop_level_maximum",
"condition": lambda v: v > 0,
"condition": lambda v: v,
"format": lambda v: v[0],
},
),
(
Expand Down Expand Up @@ -3231,6 +3227,21 @@ def _harvest_plant_booster_extra(self, infobox, base_item_type, harvest_object):
row_index=True,
)

_type_allflame_ember = _type_factory(
data_file="ItemisedNecropolisPacks.dat64",
index_column="Item",
data_mapping=(
(
"Description",
{
"template": "description",
"format": lambda v: "<br>".join(str(v).splitlines()),
},
),
),
row_index=True,
)

_cls_map = dict()
"""
This defines the expected data elements for an item class.
Expand Down Expand Up @@ -3387,6 +3398,7 @@ def _harvest_plant_booster_extra(self, infobox, base_item_type, harvest_object):
"HeistObjective": (),
"Breachstone": (_type_currency,),
"ItemisedCorpse": (_type_corpse,),
"NecropolisPack": (_type_allflame_ember,),
}

_conflict_active_skill_gems_map = {
Expand Down
7 changes: 6 additions & 1 deletion PyPoE/poe/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,9 @@ def __new__(cls, id: int, lower: str, colour: str):
class MAP_FRAGMENT_FAMILIES(IntEnumOverride):
"""
Representation of map fragment families (MapFragmentFamilies.dat)

As of the 3.24 scarab reword, it appears that each scarab has its own family,
so this enum is probably not worth maintaining.
"""

BESTIARY_AND_SULPHITE = 0 # Maybe just master-related?
Expand All @@ -626,7 +629,7 @@ class MAP_FRAGMENT_FAMILIES(IntEnumOverride):
ETERNAL = 17
TEMPLAR = 18
VAAL = 19
REGULAR = 20
REGULAR = 126

DEFAULT = REGULAR
STANDARD = REGULAR
Expand Down Expand Up @@ -818,6 +821,8 @@ class MOD_GENERATION_TYPE(IntEnumOverride):
CRUCIBLE_TREE = 31
CRUCIBLE_UNIQUE_TREE = 32
AZMERI_EMPOWERED_MONSTER = 33
NECROPOLIS_MONSTER = 34
NECROPOLIS_DEVOTED_MONSTER = 35


class WORDLISTS(IntEnumOverride):
Expand Down
6 changes: 5 additions & 1 deletion PyPoE/poe/file/shared/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ def __init__(

if files is not None:
for file in files:
read_func(file)
try:
read_func(file)
except Exception:
print("Error reading", file)
raise

def __getitem__(self, item: str) -> Any:
"""
Expand Down
Loading
Loading