Guard source gear namespaces and retain recoverable legacy records (#9)

This commit is contained in:
warren committed 2026-10-10 11:36:10 -04:00
1 parent ab37006932
commit e567910c04
23 files changed
+1203 -66

No files matched your search

+5 -1
View File
@@ -1,4 +1,5 @@
import generatedCatalog from "./generated/runewakerLootCatalog.json";
import type { ContentCategoryId } from "../app/contentCategories";
import { allowedLootDrops } from "./lootPolicy";
import { EMPTY_ITEM_STATS } from "./itemStats";
import type { InventoryItem } from "./lootTypes";
@@ -51,6 +52,8 @@ export interface RunewakerLootRollOptions {
readonly levelDelta?: number;
/** HealerMan gameplay modifier: one extra authored slot roll may be attempted. */
readonly bonusItemChance?: number;
/** Saved character/party category; dungeon category is not used as owner identity. */
readonly ownerCategory?: ContentCategoryId;
}
export const RUNEWAKER_LOOT_CATALOG = generatedCatalog as RunewakerLootCatalog;
@@ -101,6 +104,7 @@ function rollSourceSlot(
const itemLevel = Math.max(1, Math.min(255, Math.trunc(playerLevel)));
itemInstanceSequence += 1;
return Object.freeze({
contentCategory: "rom",
instanceId: `${boss.bossKey}:rw:${acquiredAt}:${itemInstanceSequence}`,
itemId: outcome.objectId,
itemKey: `runewaker-${outcome.objectId}`,
@@ -143,5 +147,5 @@ export function rollRunewakerBossLoot(
const item = rollSourceSlot(boss, bonusRoll, playerLevel, levelDelta, acquiredAt, random);
if (item) drops.push(item);
}
return allowedLootDrops(drops, playerLevel);
return allowedLootDrops(drops, playerLevel, options.ownerCategory);
}