15 lines
591 B
TypeScript
15 lines
591 B
TypeScript
import type { ContentCategoryId } from "../app/contentCategories";
|
|
import { inventoryItemUsableForCategory, type InventoryItem } from "./lootTypes";
|
|
|
|
/** Leveling dungeon bosses award cards through the separate boss-card path. */
|
|
export function allowedLootDrops(
|
|
drops: readonly InventoryItem[],
|
|
playerLevel: number,
|
|
ownerCategory?: ContentCategoryId,
|
|
): readonly InventoryItem[] {
|
|
if (!Number.isFinite(playerLevel) || playerLevel < 80) return [];
|
|
return ownerCategory === undefined
|
|
? drops
|
|
: drops.filter((item) => inventoryItemUsableForCategory(item, ownerCategory));
|
|
}
|