Guard source gear namespaces and retain recoverable legacy records (#9)
This commit is contained in:
1 parent
ab37006932
commit
e567910c04
23 files changed
+1203
-66
No files matched your search
+10
-4
@@ -1,8 +1,14 @@
|
||||
import type { InventoryItem } from "./lootTypes";
|
||||
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): readonly InventoryItem[] {
|
||||
return Number.isFinite(playerLevel) && playerLevel >= 80
|
||||
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));
|
||||
}
|
||||
Reference in new issue
Block a user