import { BASE_CLASS_IDS, type BaseClassId, } from "../app/characterCatalog"; import type { AbilityDefinition, ResourceType, } from "./abilityCatalog"; import { ascensionProgressionAbility } from "./coaAbilityCatalog"; import { ASCENSION_CLASSIC_PROGRESSION_CHAINS, ascensionClassicClassIdFromDbcId, } from "./coaLiveCatalog"; const RESOURCE_BY_CLASS: Readonly> = { warrior: "rage", paladin: "mana", hunter: "mana", rogue: "energy", priest: "mana", "death-knight": "runic-power", shaman: "mana", mage: "mana", warlock: "mana", druid: "mana", }; const abilitiesByClass = Object.fromEntries( BASE_CLASS_IDS.map((classId) => [classId, [] as AbilityDefinition[]]), ) as Record; for (const chain of ASCENSION_CLASSIC_PROGRESSION_CHAINS) { // Class-page talent ranks belong in the talent system, not in the // automatically learned spellbook. Advancement rows (Mystic Enchants) are // already excluded by the sync before a progression chain is generated. if (chain.talented) continue; const classId = ascensionClassicClassIdFromDbcId(chain.classId); if (!classId) continue; const ability = ascensionProgressionAbility( chain, classId, RESOURCE_BY_CLASS[classId], "ascension-progression", chain.id.replace(/^coa-/, "ascension-classic-"), ); if (ability) abilitiesByClass[classId].push(ability); } export const ASCENSION_CLASSIC_ABILITIES_BY_CLASS: Readonly< Record > = Object.freeze(Object.fromEntries( BASE_CLASS_IDS.map((classId) => [ classId, abilitiesByClass[classId] .sort((left, right) => left.unlockLevel - right.unlockLevel || left.name.localeCompare(right.name)), ]), )) as unknown as Readonly>;