Release v0.1.8 2026-07-13

This commit is contained in:
Warren H
2026-07-13 17:21:10 -04:00
parent 77fd434226
commit 18c416d4d2
29 changed files with 1120 additions and 159 deletions
+24
View File
@@ -0,0 +1,24 @@
import { BOSS_DEFINITIONS } from "./bossCatalog";
import type { BossId, BossMechanicId } from "./types";
/** Mechanics that cannot be resolved safely when two bosses own them at once. */
export const ENCOUNTER_EXCLUSIVE_MECHANICS: ReadonlySet<BossMechanicId> = new Set(["memory-sequence"]);
export function canAddBossToEncounter(selectedBossIds: readonly BossId[], candidateBossId: BossId) {
if (selectedBossIds.includes(candidateBossId)) return false;
const candidateMechanics = BOSS_DEFINITIONS[candidateBossId].mechanicIds;
for (const mechanicId of candidateMechanics) {
if (!ENCOUNTER_EXCLUSIVE_MECHANICS.has(mechanicId)) continue;
if (selectedBossIds.some((bossId) => BOSS_DEFINITIONS[bossId].mechanicIds.includes(mechanicId))) return false;
}
return true;
}
export function normalizeEncounterBossIds(requestedBossIds: readonly BossId[], limit = 3): BossId[] {
const selected: BossId[] = [];
for (const bossId of requestedBossIds) {
if (selected.length >= limit) break;
if (canAddBossToEncounter(selected, bossId)) selected.push(bossId);
}
return selected.length ? selected : ["bulldrome"];
}