Update Healer Man server
This commit is contained in:
1 parent
cc3b2fa4d5
commit
daa417ec17
46 files changed
+1334
-172
No files matched your search
@@ -3,21 +3,39 @@ import { describe, expect, it } from "vitest";
|
||||
import { CLASSES } from "../app/characterCatalog";
|
||||
import { DUNGEON_DEFINITIONS } from "./dungeonRegistry";
|
||||
import { dungeonBossesForDifficulty, finalDungeonBoss } from "./dungeonRunStore";
|
||||
import { BITE_SIZED_STOCKADES_DUNGEON_ID, STORMWIND_STOCKADE_DUNGEON_ID } from "./dungeonContentSource";
|
||||
import { BITE_SIZED_STOCKADES_BOSS_CANDIDATES } from "./dungeons/biteSizedStockades";
|
||||
|
||||
const stockades = DUNGEON_DEFINITIONS.find((dungeon) => dungeon.id === STORMWIND_STOCKADE_DUNGEON_ID)!;
|
||||
const biteSizedBosses = BITE_SIZED_STOCKADES_BOSS_CANDIDATES.map((candidate) => (
|
||||
stockades.bosses.find((boss) => boss.id === candidate.sourceSpawnId)!
|
||||
));
|
||||
|
||||
describe("dungeon leaderboard catalog", () => {
|
||||
it("keeps the server's final bosses, boss lists, difficulties, and classes aligned with the game", () => {
|
||||
const catalog = {
|
||||
dungeons: DUNGEON_DEFINITIONS.map((dungeon) => ({ id: dungeon.id, title: dungeon.title,
|
||||
finalBossId: finalDungeonBoss(dungeon)?.id ?? "",
|
||||
bosses: dungeon.bosses.map((boss) => ({ id: boss.id, name: boss.name })),
|
||||
finalBossId: dungeon.id === BITE_SIZED_STOCKADES_DUNGEON_ID
|
||||
? biteSizedBosses[0].id
|
||||
: finalDungeonBoss(dungeon)?.id ?? "",
|
||||
bosses: (dungeon.id === BITE_SIZED_STOCKADES_DUNGEON_ID ? biteSizedBosses : dungeon.bosses)
|
||||
.map((boss) => ({ id: boss.id, name: boss.name })),
|
||||
difficulties: dungeon.difficultyVariants.map((difficulty) => ({ id: difficulty.id, name: difficulty.difficulty,
|
||||
bossIds: dungeonBossesForDifficulty(dungeon, difficulty.id).map((boss) => boss.id),
|
||||
finalBossId: finalDungeonBoss(dungeon, difficulty.id)?.id ?? "" })),
|
||||
bossIds: dungeon.id === BITE_SIZED_STOCKADES_DUNGEON_ID
|
||||
? biteSizedBosses.map((boss) => boss.id)
|
||||
: dungeonBossesForDifficulty(dungeon, difficulty.id).map((boss) => boss.id),
|
||||
finalBossId: dungeon.id === BITE_SIZED_STOCKADES_DUNGEON_ID
|
||||
? biteSizedBosses[0].id
|
||||
: finalDungeonBoss(dungeon, difficulty.id)?.id ?? "",
|
||||
...(dungeon.id === BITE_SIZED_STOCKADES_DUNGEON_ID
|
||||
? { finalBossIds: biteSizedBosses.map((boss) => boss.id) }
|
||||
: {}),
|
||||
})),
|
||||
defaultDifficultyId: dungeon.defaultDifficultyId,
|
||||
})).sort((a, b) => a.id.localeCompare(b.id)),
|
||||
classes: CLASSES.map((entry) => ({ id: entry.id, name: entry.name })),
|
||||
};
|
||||
expect(catalog.dungeons).toHaveLength(84);
|
||||
expect(catalog.dungeons).toHaveLength(85);
|
||||
expect(catalog.dungeons.filter((dungeon) => dungeon.bosses.length > 0 && !dungeon.finalBossId)).toEqual([]);
|
||||
const path = "src/game/generated/dungeonLeaderboardCatalog.generated.json";
|
||||
if (process.env.WRITE_DUNGEON_LEADERBOARD_CATALOG === "1") writeFileSync(path, `${JSON.stringify(catalog, null, 2)}\n`);
|
||||
|
||||
Reference in new issue
Block a user