diff --git a/d2warehouse/item.py b/d2warehouse/item.py index 76b8595..dea2dc7 100644 --- a/d2warehouse/item.py +++ b/d2warehouse/item.py @@ -96,7 +96,7 @@ class Item: lvl: int | None = None quality: Quality | None = None graphic: int | None = None - inherent: int | None = None + implicit: int | None = None low_quality: LowQualityType | None = None prefixes: list[int] | None = None suffixes: list[int] | None = None diff --git a/d2warehouse/parser.py b/d2warehouse/parser.py index b5a77f9..5a806db 100644 --- a/d2warehouse/parser.py +++ b/d2warehouse/parser.py @@ -156,7 +156,7 @@ def parse_item(data: bytes) -> tuple[bytes, Item]: item.graphic, graphic_end = parse_item_graphic(bits[extended_end:]) graphic_end += extended_end - item.inherent, inherent_end = parse_inherent_mod(bits[graphic_end:]) + item.implicit, inherent_end = parse_implicit_mod(bits[graphic_end:]) inherent_end += graphic_end item, quality_end = parse_quality_data(bits[inherent_end:], item) @@ -210,11 +210,13 @@ def parse_item_graphic(bits: bitarray) -> tuple[int | None, int]: return ba2int(bits[1:4]), 4 -def parse_inherent_mod(bits: bitarray) -> tuple[int | None, int]: +def parse_implicit_mod(bits: bitarray) -> tuple[int | None, int]: + # References a row in automagic.txt which adds an implicit mod to the item. + # However, that mod seems to also be present in the stats at the end. if not bits[0]: return None, 1 else: - return ba2int(bits[1:4]), 4 + return ba2int(bits[1:11]), 12 def parse_extended_item(bits: bitarray) -> tuple[int, int, Quality]: