Release Healer Man 0.1.21
This commit is contained in:
1 parent
699fc858c9
commit
f6f2375145
210 files changed
+976039
-6247
No files matched your search
@@ -5,6 +5,7 @@ import {
|
||||
type WeaponStats,
|
||||
} from "./itemStats";
|
||||
import type { InventoryItem, ItemQuality } from "./lootTypes";
|
||||
import { rollRunewakerBossLoot, runewakerBossHasLoot } from "./runewakerLootCatalog";
|
||||
|
||||
export interface LootCatalogItem {
|
||||
readonly itemId: number;
|
||||
@@ -58,7 +59,8 @@ export function bossLootTable(bossKey: string): BossLootTable | null {
|
||||
}
|
||||
|
||||
export function bossHasLoot(bossKey: string): boolean {
|
||||
return (bossLootByKey.get(bossKey)?.items.length ?? 0) > 0;
|
||||
return (bossLootByKey.get(bossKey)?.items.length ?? 0) > 0
|
||||
|| runewakerBossHasLoot(bossKey);
|
||||
}
|
||||
|
||||
function boundedRandom(random: () => number): number {
|
||||
@@ -98,7 +100,9 @@ export function rollBossLoot(
|
||||
options: LootRollOptions = {},
|
||||
): readonly InventoryItem[] {
|
||||
const table = bossLootTable(bossKey);
|
||||
if (!table?.items.length) return [];
|
||||
if (!table?.items.length) {
|
||||
return rollRunewakerBossLoot(bossKey, playerLevel, options);
|
||||
}
|
||||
const random = options.random ?? Math.random;
|
||||
const acquiredAt = options.now ?? Date.now();
|
||||
const rolls = randomInteger(table.rollsMin, table.rollsMax, random);
|
||||
|
||||
Reference in new issue
Block a user