Skip to content

seals and charms#763

Open
chrizzocb wants to merge 29 commits into
d4lfteam:mainfrom
chrizzocb:Update-profile_models
Open

seals and charms#763
chrizzocb wants to merge 29 commits into
d4lfteam:mainfrom
chrizzocb:Update-profile_models

Conversation

@chrizzocb

Copy link
Copy Markdown
Contributor

ProfileModel rejected Seals and Charms because those sections were not defined. TTS could classify HoradricSeal/Charm, but read_descr treated them as unsupported non-equipment and returned None. Changed files:

src/config/profile_models.py
src/item/data/item_type.py
src/item/descr/read_descr_tts.py
src/item/filter.py
tests/config/models_test.py
tests/item/read_descr_tts_test.py
tests/item/filter/filter_test.py

chrizzocb added 2 commits May 29, 2026 20:51
ProfileModel rejected Seals and Charms because those sections were not defined.
TTS could classify HoradricSeal/Charm, but read_descr treated them as unsupported non-equipment and returned None.
Changed files:

src/config/profile_models.py
src/item/data/item_type.py
src/item/descr/read_descr_tts.py
src/item/filter.py
tests/config/models_test.py
tests/item/read_descr_tts_test.py
tests/item/filter/filter_test.py
Comment thread src/item/data/item_type.py Outdated
Comment thread src/config/profile_models.py Outdated
Comment thread src/item/filter.py
Comment thread src/scripts/vision_mode_with_highlighting.py Outdated
Comment thread src/item/descr/read_descr_tts.py
chrizzocb and others added 10 commits May 30, 2026 09:48
big update
Charms and Seals shared a generic spellcraft filter model, so charm identity fields and seal slot count could not be represented or matched. Charm set data also was not exposed on parsed Items.
Changed files:
src/config/profile_models.py: added separate CharmFilterModel and SealFilterModel.
src/item/filter.py: added charm set/uniqueAspect matching and seal slotCount matching.
src/item/descr/read_descr_tts.py, src/item/models.py, src/dataloader.py: parse/store charm set names using sets.json.
Importer/editor files updated to create the correct charm/seal model types.
Targeted tests updated for model validation, matching, and charm set parsing.
Root cause:
Seals only supported slotCount; there was no separate field for “boosts this set”. Seal TTS also did not store the detected boosted set on the parsed Item.

Changed files:

src/config/profile_models.py: added SealFilterModel.boostedSet, validated against sets.json.
src/item/models.py: added boosted_set_name.
src/item/descr/read_descr_tts.py: set detection now supports both charms and seals; seals populate boosted_set_name.
src/item/filter.py: seal matching now checks boostedSet alongside existing criteria.
Updated targeted tests in tests/config/models_test.py, tests/item/filter/filter_test.py, tests/item/read_descr_tts_test.py.

Seals:
  - CrucibleFury:
      boostedSet: berserkers_crucible
      affixPool:
        - count:
            - maximum_fury
Comment thread src/config/profile_models.py Outdated
Comment thread src/config/profile_models.py Outdated
Comment thread src/config/profile_models.py Outdated
Comment thread src/config/profile_models.py Outdated
Comment thread src/config/profile_models.py Outdated
Comment thread src/item/filter.py Outdated
Comment thread src/item/filter.py Outdated
Comment thread src/item/models.py
Comment thread tests/item/read_descr_tts_test.py Outdated
Comment thread tests/item/read_descr_tts_test.py Outdated

@cjshrader cjshrader left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you're still working on it, I see there are some unaddressed comments but you're not done.

Comment thread src/config/profile_models.py
Comment thread src/config/profile_models.py Outdated
Comment thread src/config/profile_models.py Outdated
Comment thread src/config/profile_models.py
Comment thread src/config/profile_models.py Outdated
Comment thread src/item/descr/read_descr_tts.py Outdated
Comment thread src/item/descr/read_descr_tts.py Outdated
Comment thread src/item/descr/read_descr_tts.py Outdated
Comment thread src/item/descr/read_descr_tts.py Outdated
def _get_aspect_from_tts_section(tts_section: list[str], item: Item, start: int, num_affixes: int):
# Grab the aspect as well in this case
if item.rarity in [ItemRarity.Mythic, ItemRarity.Unique, ItemRarity.Legendary]:
if item.rarity in [ItemRarity.Mythic, ItemRarity.Unique, ItemRarity.Legendary] and not is_seal_or_charm(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry to say mythic charms have an aspect:

Image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unique charms too. This code would skip them

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read_descr_tts.py
— removed the is_seal_or_charm exclusion so aspects are parsed for all Mythic/Unique/Legendary items regardless of type.

update14

@cjshrader cjshrader left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review all of your other test data and make sure it's real. I haven't been able to review everything

Comment thread assets/lang/enUS/affixes.json Outdated
"chance_when_struck_to_gain_life_as_barrier_for_seconds": "chance when struck to gain life as barrier for seconds",
"charge_cooldown_reduction": "charge cooldown reduction",
"charge_damage": "charge damage",
"charm_slot": "charm slot",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't have charm affix data in our data, I'd rather see if we can update gen_data to find it as this is surely not a comprehensive list.

I'm ok if charm/seal affix data goes in its own file. That'll make the using the profile editor easier. I'm ok if both even end up in their own individual files if they don't overlap.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear I'd prefer it if they could be in their own files, if possible

Comment thread assets/lang/enUS/How to add to these files.md
Comment thread src/config/data.py
(3393, 911), # Bottom-Right
(3126, 1066), # Bottom (Locked in screenshot)
(2865, 915), # Bottom-Left
(2861, 622), # Top-Left

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah cool, so this is where this stuff is

Comment thread assets/lang/enUS/corrections.json
DynamicItemFilterModel = RootModel[dict[str, ItemFilterModel]]


class SealCharmFilterModel(BaseModel):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure we keep everything alphabetical, this should be lower in the file

Comment thread src/item/filter.py
Comment thread src/item/models.py
Comment thread src/scripts/__init__.py
Comment thread tests/item/read_descr_season_13_tts_test.py
Comment thread tests/item/read_descr_season_13_tts_test.py
cjshrader and others added 2 commits June 6, 2026 09:00
getting new data from d4data
seals_affixes and charms_affixes

all verfied via
 uv run python -m src.tools.gen_data d4data
@field_validator("set_name")
@classmethod
def set_must_exist(cls, name: str | None) -> str | None:
return _normalize_existing_set_name(name, "set")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unique_aspect is only normalized here; it is never checked against Dataloader().aspect_unique_dict. An editable combo can still save an invalid value, and the filter will silently never match. This should mirror the set_name validator.

Comment thread src/item/filter.py
@staticmethod
def _match_charm_filter(item: Item, filter_spec: CharmFilterModel) -> bool:
identity_fields = [filter_spec.set_name, filter_spec.unique_aspect]
if not any(identity_fields):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If both set_name and unique_aspect are populated, this returns true when either one matches. That makes the filter broader than the editor implies; if users can fill both fields, it should probably require both to match (or the model should forbid setting both at once).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants