Skip to content

Fix crafted item and embellishment handling - #1788

Open
DIzosimov wants to merge 1 commit into
Voulk:devfrom
DIzosimov:embellishment-and-crafted-fixes
Open

DIzosimov wants to merge 1 commit into
Voulk:devfrom
DIzosimov:embellishment-and-crafted-fixes

Conversation

@DIzosimov

Copy link
Copy Markdown

First of three, split out of #1787 following review. Independent of the other two.

Embellishments

Embellishments were driven by three hardcoded lists that had drifted apart from each other and from EmbellishmentDB, so items were silently dropped rather than scored:

  • getItemEffectOptions offered seven embellishments and excluded Finger/Neck outright, so jewellery embellishments could never be attached. Now derived from EmbellishmentDB via new applicable / slots metadata.
  • The SimC importer matched incoming spell names against an allowlist of eight names and discarded everything else — an imported item lost its embellishment and scored as a plain stat stick, with no error. Now resolves against the same DB. The two entry points also disagreed with each other: Sunfire Silk Lining imported but couldn't be added manually, and Adorned Fang was the reverse.
  • Crafted items that carry an embellishment inherently (Axe-Flingin' Bands, the World Tender's set) have no effect block in ItemDB and simmed as plain gear. Item now attaches those from EmbellishmentDB.setItems, so a gap in ItemDB can't silently drop them again.
  • Multi-piece embellishment sets are granted once, only when enough pieces are worn, and consume embellishment slots correctly.
  • Embellishments with no formula (Devouring Banding, Murder Row Materials) are flagged unmodelled and withheld from the dropdown rather than silently scoring zero. A test fails if a formula lands and the flag isn't removed.
  • The crafted stat picker is hidden on items with no assignable budget. Generic crafts are all unallocated so this is nearly always shown; it's the fixed-embellished items where a picker implies a choice that has no effect.

Weapons

buildNewWepCombos only emitted a one-hander when it could pair it with an offhand. With no offhand the weapon was invisible to Top Gear — and if it was the player's only weapon there were zero combos, zero sets, and an empty report. Unpaired one-handers are now offered alone, with report advice noting the offhand slot is scored as empty.

Embellishment cap

Exceeding two embellishments makes every set fail verifySet. That's correct, but it was silent: the offending item was dropped from every result, or the whole report came back empty with no explanation. The selection screen now warns when the cap makes a set impossible, the report explains when a selected embellished item couldn't be used, and the engine reports the error instead of returning a bare null.

Also

Two latent crashes where getSetting returns 0 for a missing setting and the result was used as a string — darkmoonHuntStat in the Darkmoon Sigil formula, and flaskChoice, which would take out an entire Top Gear run on stale settings.

createTopGearWorker moved into its own module so TopGearEngineShared can be imported from tests without tripping over import.meta.

Testing

44 suites / 233 tests passing, production build clean. Adds four suites covering the embellishment DB contract, the SimC import path, weapon combinations, and the embellishment cap.

Embellishments were driven by three hardcoded lists that had drifted apart from each other and from
EmbellishmentDB, so items were silently dropped rather than scored:

- getItemEffectOptions offered seven embellishments and excluded Finger/Neck outright, so jewellery embellishments
  could never be attached. Now derived from EmbellishmentDB via new applicable / slots metadata.
- The SimC importer matched incoming spell names against an allowlist of eight names and discarded everything else,
  so an imported item lost its embellishment and scored as a plain stat stick with no error. Now resolves against
  the same DB. The two entry points also disagreed with each other: Sunfire Silk Lining imported but could not be
  added manually, and Adorned Fang was the reverse.
- Crafted items that carry an embellishment inherently (Axe-Flingin' Bands, the World Tender's set) have no effect
  block in ItemDB and simmed as plain gear. Item now attaches those from EmbellishmentDB.setItems so a gap in
  ItemDB can't silently drop them again.
- Multi-piece embellishment sets are granted once, only when enough pieces are worn, and consume embellishment
  slots correctly.
- Embellishments with no formula are flagged unmodelled and withheld from the dropdown rather than silently
  scoring zero. A test fails if a formula lands and the flag isn't removed.
- The crafted stat picker is hidden on items with no assignable budget, where choosing stats did nothing.

Weapons: buildNewWepCombos only emitted a one hander when it could pair it with an offhand. With no offhand the
weapon was invisible to Top Gear, and if it was the player's only weapon there were zero combos, zero sets and an
empty report. Unpaired one handers are now offered alone, with report advice noting the offhand is scored as empty.

Embellishment cap: exceeding two embellishments makes every set fail verifySet. That's correct but was silent, so
the item was dropped from all results or the whole report came back empty. The selection screen now warns when the
cap makes a set impossible, the report explains when a selected embellished item couldn't be used, and the engine
reports the error rather than returning a bare null.

Also fixes a latent crash where getSetting returns 0 for a missing setting and the result was used as a string
(darkmoonHuntStat, and flaskChoice which would take out an entire Top Gear run on stale settings), and moves
createTopGearWorker into its own module so TopGearEngineShared can be imported from tests without tripping over
import.meta.

44 suites / 233 tests passing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5STi454aLVN1cAsYyba3J
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.

1 participant