Update class mechanics, stat rulesets, and CoA reference catalogs
This commit is contained in:
1 parent
b16821e92e
commit
39458d5de6
221 files changed
+2584962
-568
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
classById,
|
||||
isRomClassId,
|
||||
type ClassId,
|
||||
} from "../app/characterCatalog";
|
||||
import {
|
||||
@@ -22,6 +23,8 @@ import {
|
||||
import { LOOT_CATALOG, type LootCatalogItem } from "./lootCatalog";
|
||||
import type { InventoryItem } from "./lootTypes";
|
||||
import type { PartyRole } from "./partyRoles";
|
||||
import { romNativeGearReference } from "./romNativeGear";
|
||||
import { romNativeGearFromSharedDirectStats, sumRomNativeGearStats } from "./romNativeStatsTypes";
|
||||
import {
|
||||
gearProfileFor,
|
||||
isRomHybridGearClass,
|
||||
@@ -213,7 +216,12 @@ function scaleStats(stats: ItemStats, factor: number): ItemStats {
|
||||
damageMin: Math.max(1, Math.round(weapon.damageMin * factor * 10) / 10),
|
||||
damageMax: Math.max(2, Math.round(weapon.damageMax * factor * 10) / 10),
|
||||
} : null;
|
||||
return Object.freeze({ ...numeric, meleeWeapon: scaleWeapon(stats.meleeWeapon), rangedWeapon: scaleWeapon(stats.rangedWeapon) });
|
||||
return Object.freeze({
|
||||
...numeric,
|
||||
meleeWeapon: scaleWeapon(stats.meleeWeapon),
|
||||
rangedWeapon: scaleWeapon(stats.rangedWeapon),
|
||||
...(stats.romNative ? { romNative: stats.romNative } : {}),
|
||||
});
|
||||
}
|
||||
|
||||
function heirloomItem(
|
||||
@@ -240,6 +248,9 @@ function heirloomItem(
|
||||
? { ...distributedStats, blockValue: Math.max(1, Math.round(level * weight * 0.45)) }
|
||||
: distributedStats;
|
||||
const sourceWeapon = weaponStats(slot, inventorySlot, weaponType, budget);
|
||||
const romNative = isRomClassId(context.classId)
|
||||
? romNativeGearReference(context.classId, slot, level)
|
||||
: null;
|
||||
let stats = itemStatsFor({
|
||||
itemId: 9_000_000,
|
||||
quality: "heirloom",
|
||||
@@ -250,6 +261,7 @@ function heirloomItem(
|
||||
sourceItemLevel: level,
|
||||
sourceStats,
|
||||
sourceWeapon,
|
||||
...(romNative ? { romNative } : {}),
|
||||
});
|
||||
const currentScore = specializationScore(stats, profile);
|
||||
const catalogScore = isRomHybridGearClass(context.classId) ? 0 : highestCatalogScore(context.classId, slot, level, profile)
|
||||
@@ -329,12 +341,16 @@ export function equipmentStatsForItems(items: readonly InventoryItem[]): ItemSta
|
||||
const numeric = Object.fromEntries(ITEM_STAT_KEYS.map((key) => [key, 0])) as Record<NumericItemStatKey, number>;
|
||||
let meleeWeapon: WeaponStats | null = null;
|
||||
let rangedWeapon: WeaponStats | null = null;
|
||||
const nativePayloads = [] as NonNullable<ItemStats["romNative"]>[];
|
||||
for (const item of items) {
|
||||
for (const key of ITEM_STAT_KEYS) numeric[key] += item.stats[key];
|
||||
const nativePayload = item.stats.romNative ?? romNativeGearFromSharedDirectStats(item.stats);
|
||||
if (nativePayload) nativePayloads.push(nativePayload);
|
||||
if (item.stats.meleeWeapon) meleeWeapon = item.stats.meleeWeapon;
|
||||
if (item.stats.rangedWeapon) rangedWeapon = item.stats.rangedWeapon;
|
||||
}
|
||||
return Object.freeze({ ...numeric, meleeWeapon, rangedWeapon });
|
||||
const romNative = sumRomNativeGearStats(nativePayloads);
|
||||
return Object.freeze({ ...numeric, meleeWeapon, rangedWeapon, ...(romNative ? { romNative } : {}) });
|
||||
}
|
||||
|
||||
export function resolvedEquipmentStats(
|
||||
|
||||
Reference in new issue
Block a user