Validate RoM primary five hybrid stats and pair mechanics
This commit is contained in:
1 parent
8e95480d4f
commit
c8b3a3d95a
18 files changed
+2061
-48
No files matched your search
+41
-4
@@ -114,6 +114,42 @@ const RACE_DBC = Object.fromEntries(RACES.map((entry) => [entry.id, entry.dbcId]
|
||||
|
||||
const classUsesMana = (classId: ClassId): boolean => classById(classId).resourceSummary.includes("Mana");
|
||||
|
||||
/** The five playable RoM pairs use Wrath base curves alongside their hybrid heirlooms. */
|
||||
const ROM_HYBRID_BASE_RACE: Partial<Readonly<Record<ClassId, RaceId>>> = Object.freeze({
|
||||
"rom-knight": "human",
|
||||
"rom-priest": "human",
|
||||
"rom-scout": "night-elf",
|
||||
"rom-rogue": "human",
|
||||
// Dwarf Mage was not a 3.3.5 race/class combination; Human supplies its class curve.
|
||||
"rom-mage": "human",
|
||||
});
|
||||
|
||||
function romHybridBase(
|
||||
classId: ClassId,
|
||||
secondaryClassId: ClassId | null | undefined,
|
||||
level: number,
|
||||
): { readonly attributes: PrimaryAttributes; readonly resources: { readonly health: number; readonly mana: number } } | null {
|
||||
const race = ROM_HYBRID_BASE_RACE[classId];
|
||||
if (!race) return null;
|
||||
const primaryAttributes = baseAttributesFor(classId, level, race);
|
||||
const primaryResources = baseResourcesFor(classId, level);
|
||||
const secondary = level >= 10 && secondaryClassId && isRomClassId(secondaryClassId)
|
||||
? secondaryClassId : null;
|
||||
const secondaryAttributes = secondary
|
||||
? baseAttributesFor(secondary, level, ROM_HYBRID_BASE_RACE[secondary] ?? "human") : null;
|
||||
const secondaryResources = secondary ? baseResourcesFor(secondary, level) : null;
|
||||
const attributes = Object.fromEntries((Object.keys(primaryAttributes) as (keyof PrimaryAttributes)[]).map((key) => [
|
||||
key, primaryAttributes[key] + (secondaryAttributes?.[key] ?? 0) * .1,
|
||||
])) as unknown as PrimaryAttributes;
|
||||
return {
|
||||
attributes,
|
||||
resources: {
|
||||
health: primaryResources.health + (secondaryResources?.health ?? 0) * .1,
|
||||
mana: primaryResources.mana + (secondaryResources?.mana ?? 0) * .1,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Automatic racial auras from Ascension's effective Spell.dbc that can change
|
||||
* a character's starting attributes or resource pools.
|
||||
@@ -259,15 +295,16 @@ export function deriveCharacterStats(
|
||||
secondaryClassId?: ClassId | null,
|
||||
): CharacterStats {
|
||||
const safe = safeLevel(level);
|
||||
const romBase = romDualClassBaseStats(classId, secondaryClassId, safe);
|
||||
const base = romBase ? {
|
||||
const hybridBase = romHybridBase(classId, secondaryClassId, safe);
|
||||
const romBase = hybridBase ? null : romDualClassBaseStats(classId, secondaryClassId, safe);
|
||||
const base = hybridBase?.attributes ?? (romBase ? {
|
||||
strength: romBase.strength,
|
||||
agility: romBase.agility,
|
||||
stamina: romBase.stamina,
|
||||
intellect: romBase.intellect,
|
||||
spirit: romBase.wisdom,
|
||||
} : baseAttributesFor(classId, safe, raceId);
|
||||
const resources = romBase ? { health: romBase.health, mana: romBase.mana } : baseResourcesFor(classId, safe);
|
||||
} : baseAttributesFor(classId, safe, raceId));
|
||||
const resources = hybridBase?.resources ?? (romBase ? { health: romBase.health, mana: romBase.mana } : baseResourcesFor(classId, safe));
|
||||
const racial = RACIAL_STAT_PASSIVES[raceId];
|
||||
const strength = percentAdjusted(base.strength + gear.strength, racial?.strength, modifiers.strength);
|
||||
const agility = percentAdjusted(base.agility + gear.agility, racial?.agility, modifiers.agility);
|
||||
|
||||
Reference in new issue
Block a user