Commit Graph
3 Commits
Author SHA1 Message Date
dfj b66491c5be Tailor stat comparison and scoring to each spec
Replace the flat per-spec key list with SPEC_STAT_PROFILES: an ordered
{ stat, weight } table for every class/spec. The panel now shows what
matters to the selected spec instead of falling back to spell stats for
physical specs: casters get spell damage/hit/crit/haste, melee get
strength/AP/hit/expertise/armor pen, tanks get stamina/armor/defense/
dodge/parry/block, healers get healing/spirit/MP5.

The same weights drive upgrade ranking, the completion ratio, and which
two gains are shown in the top-upgrades line, so e.g. spell damage
outweighs spirit for Shadow while stamina outweighs expertise for a
Protection tank.

Add GetItemStats mappings for physical stats (attack power, ranged/feral
AP, strength, agility, hit, expertise, armor pen, defense, dodge, parry,
block, block value, armor). TBC per-school hit/crit/haste keys fold into
one stat. Drop the unused spellPower row from TBC profiles.

Tests: weighted scoring expectations, physical/tank mappings, profile
coverage and 8-row panel limit, weighted ratios. 104 passing.
2026-10-24 01:00:24 +02:00
dfj e08e288f73 Read TBC school-specific haste and crit item stats
TBC items report per-school ratings with a different key shape than the
WotLK-era names the addon mapped: "spell haste" is
ITEM_MOD_HASTE_SPELL_RATING(_SHORT), not ITEM_MOD_SPELL_HASTE_RATING,
and crit is ITEM_MOD_CRIT_SPELL_RATING/MELEE/RANGED rather than
ITEM_MOD_SPELL_CRIT_RATING. As a result spell haste (and spell/melee
crit) on TBC gear scanned as zero, so the stats panel showed no haste
and upgrade scoring ignored it.

Map the TBC haste/crit keys alongside the existing generic ones, plus
non-_SHORT variants for safety. The alias logic still takes MAX per
stat, so an item that reports both forms is not double counted.

Tests cover TBC spell haste + crit, melee/ranged haste keys, and
generic+school-specific de-duplication. 96 passing.
2026-10-24 00:50:02 +02:00
dfj 7fda3db472 Add offline unit test suite for data and core logic
76 tests covering BIS data integrity (all classes/specs/phases, slot
shape, spot checks), ScanItemStats alias aggregation (Frozen
Shadoweave double-count regression), CompareGear upgrade ranking with
spec-specific stat keys, phase resolution, and latest-phase completion.
Runs with any Lua 5.3+ interpreter via mocked WoW API; no client
required. Not referenced in the .toc.
2026-10-11 16:00:24 +02:00