@@ -76,7 +76,7 @@ def _get_affix_counts(tts_section: list[str], item: Item, start: int) -> tuple[i
7676 # This will also grab up slotted gems but we really don't have much choice
7777 if item .rarity == ItemRarity .Rare and any (
7878 tts_section [start + inherent_num + affixes_num - 1 ].lower ().startswith (x )
79- for x in ["empty socket" , "requires level" , "properties lost when equipped" ]
79+ for x in ["empty socket" , "requires level" , "properties lost when equipped" , "rampage:" , "feast:" , "hunger:" ]
8080 ):
8181 affixes_num = 3
8282 elif item .rarity == ItemRarity .Legendary and tts_section [start + inherent_num + affixes_num - 1 ].lower ().startswith (
@@ -91,7 +91,8 @@ def _get_affix_counts(tts_section: list[str], item: Item, start: int) -> tuple[i
9191def _add_affixes_from_tts (tts_section : list [str ], item : Item ) -> Item :
9292 starting_index = _get_affix_starting_location_from_tts_section (tts_section , item )
9393 inherent_num , affixes_num = _get_affix_counts (tts_section , item , starting_index )
94- affixes = _get_affixes_from_tts_section (tts_section , item , starting_index , inherent_num + affixes_num )
94+ affixes = _get_affixes_from_tts_section (tts_section , starting_index , inherent_num + affixes_num )
95+ aspect_text = _get_aspect_from_tts_section (tts_section , item , starting_index , len (affixes ))
9596 for i , affix_text in enumerate (affixes ):
9697 if i < inherent_num :
9798 affix = _get_affix_from_text (affix_text )
@@ -100,12 +101,14 @@ def _add_affixes_from_tts(tts_section: list[str], item: Item) -> Item:
100101 elif i < inherent_num + affixes_num :
101102 affix = _get_affix_from_text (affix_text )
102103 item .affixes .append (affix )
103- elif item .rarity == ItemRarity .Mythic :
104- item .aspect = Aspect (name = item .name , text = affix_text , value = find_number (affix_text ))
104+
105+ if aspect_text :
106+ if item .rarity == ItemRarity .Mythic :
107+ item .aspect = Aspect (name = item .name , text = aspect_text , value = find_number (aspect_text ))
105108 elif item .rarity == ItemRarity .Unique :
106- item .aspect = _get_aspect_from_text (affix_text , item .name )
109+ item .aspect = _get_aspect_from_text (aspect_text , item .name )
107110 else :
108- item .aspect = _get_aspect_from_name (affix_text , item .name )
111+ item .aspect = _get_aspect_from_name (aspect_text , item .name )
109112 return item
110113
111114
@@ -118,7 +121,8 @@ def _add_affixes_from_tts_mixed(
118121) -> Item :
119122 starting_index = _get_affix_starting_location_from_tts_section (tts_section , item )
120123 inherent_num , affixes_num = _get_affix_counts (tts_section , item , starting_index )
121- affixes = _get_affixes_from_tts_section (tts_section , item , starting_index , inherent_num + affixes_num )
124+ affixes = _get_affixes_from_tts_section (tts_section , starting_index , inherent_num + affixes_num )
125+ aspect_text = _get_aspect_from_tts_section (tts_section , item , starting_index , len (affixes ))
122126
123127 # With advanced item compare on we'll actually find more bullets than we need, so we don't rely on them for number of affixes
124128 if len (affixes ) - 1 > len (affix_bullets ):
@@ -140,22 +144,23 @@ def _add_affixes_from_tts_mixed(
140144 else :
141145 affix .type = AffixType .normal
142146 item .affixes .append (affix )
147+
148+ if aspect_text :
149+ if item .rarity == ItemRarity .Mythic :
150+ item .aspect = Aspect (name = item .name , text = aspect_text , value = find_number (aspect_text ))
151+ elif item .rarity == ItemRarity .Unique :
152+ item .aspect = _get_aspect_from_text (aspect_text , item .name )
143153 else :
144- if item .rarity == ItemRarity .Mythic :
145- item .aspect = Aspect (name = item .name , text = affix_text , value = find_number (affix_text ))
146- elif item .rarity == ItemRarity .Unique :
147- item .aspect = _get_aspect_from_text (affix_text , item .name )
154+ item .aspect = _get_aspect_from_name (aspect_text , item .name )
155+ if item .aspect :
156+ if not aspect_bullet :
157+ LOGGER .warning (
158+ "No bullet was found for the aspect. If the aspect's first line is partially or fully off "
159+ "the screen, you can ignore this warning. Otherwise, please report a bug with a screenshot "
160+ "of the item."
161+ )
148162 else :
149- item .aspect = _get_aspect_from_name (affix_text , item .name )
150- if item .aspect :
151- if not aspect_bullet :
152- LOGGER .warning (
153- "No bullet was found for the aspect. If the aspect's first line is partially or fully off "
154- "the screen, you can ignore this warning. Otherwise, please report a bug with a screenshot "
155- "of the item."
156- )
157- else :
158- item .aspect .loc = aspect_bullet .center
163+ item .aspect .loc = aspect_bullet .center
159164 return item
160165
161166
@@ -260,7 +265,7 @@ def _create_base_item_from_tts(tts_item: list[str]) -> Item | None:
260265 if any ("sanctified" in tts_item [i ].lower () for i in range (3 , min (7 , len (tts_item )))):
261266 item .seasonal_attribute = SeasonalAttribute .sanctified
262267
263- search_string = tts_item [1 ].lower ().replace ("ancestral" , "" ).replace ("chaos " , "" ).strip ()
268+ search_string = tts_item [1 ].lower ().replace ("ancestral" , "" ).replace ("bloodied " , "" ).strip ()
264269 search_string = _REPLACE_COMPARE_RE .sub ("" , search_string ).strip ()
265270 search_string_split = search_string .split (" " )
266271 item .rarity = _get_item_rarity (search_string_split [0 ])
@@ -311,12 +316,19 @@ def _get_index_of_armor_dps_or_all_resist(tts_section: list[str], indicator: str
311316 return 0
312317
313318
314- def _get_affixes_from_tts_section (tts_section : list [str ], item : Item , start : int , length : int ):
319+ def _get_affixes_from_tts_section (tts_section : list [str ], start : int , length : int ):
320+ return tts_section [start : start + length ]
321+
322+
323+ def _get_aspect_from_tts_section (tts_section : list [str ], item : Item , start : int , num_affixes : int ):
315324 # Grab the aspect as well in this case
316325 if item .rarity in [ItemRarity .Mythic , ItemRarity .Unique , ItemRarity .Legendary ]:
317- length += 1
326+ aspect_index = start + num_affixes
327+ if item .seasonal_attribute == SeasonalAttribute .bloodied :
328+ aspect_index = aspect_index + 1
329+ return tts_section [aspect_index ]
318330
319- return tts_section [ start : start + length ]
331+ return None
320332
321333
322334def _get_affix_from_text (text : str ) -> Affix :
0 commit comments