forked from phenom/healer-man
Release Healer Man 0.1.32
This commit is contained in:
1 parent
d3d6aaebdb
commit
6dcb1034e5
102 files changed
+10772
-788
No files matched your search
@@ -44,6 +44,8 @@ const config = await readJson(configFile);
|
||||
const dungeon = (config.dungeons ?? []).find((entry) => entry.id === dungeonConfigId);
|
||||
if (!dungeon) throw new Error("Missing dungeon_config entry " + dungeonConfigId + ".");
|
||||
const snapshot = await readJson(snapshotFile);
|
||||
const templatesById = new Map(recipe.templates.map((template) => [template.id, template]));
|
||||
const rowsBySpawnId = new Map((snapshot.rows ?? []).map((row) => [row.spawnId, row]));
|
||||
|
||||
const SIGNALS = [
|
||||
{ kind: "summon", pattern: /summon|spawn.*npc|create.*npc|create.*monster|add.*npc/i },
|
||||
@@ -115,10 +117,11 @@ for (const fileName of dungeon.lua_files ?? []) {
|
||||
|
||||
const templateMetadata = new Map();
|
||||
for (const row of snapshot.rows ?? []) {
|
||||
const template = templatesById.get(row.templateId);
|
||||
const metadata = templateMetadata.get(row.templateId) ?? {
|
||||
templateId: row.templateId,
|
||||
name: row.name,
|
||||
classification: row.classification,
|
||||
name: template?.name ?? row.name,
|
||||
classification: template?.classification ?? row.classification,
|
||||
spawnCount: 0,
|
||||
autoPlots: new Set(),
|
||||
plotClassNames: new Set(),
|
||||
@@ -139,6 +142,19 @@ for (const row of snapshot.rows ?? []) {
|
||||
}
|
||||
templateMetadata.set(row.templateId, metadata);
|
||||
}
|
||||
for (const template of recipe.templates) {
|
||||
if (templateMetadata.has(template.id)) continue;
|
||||
templateMetadata.set(template.id, {
|
||||
templateId: template.id,
|
||||
name: template.name,
|
||||
classification: template.classification,
|
||||
spawnCount: 0,
|
||||
autoPlots: new Set(template.source?.scriptRoots ?? []),
|
||||
plotClassNames: new Set(),
|
||||
templateScripts: new Map(),
|
||||
spells: new Map(),
|
||||
});
|
||||
}
|
||||
|
||||
const templateCandidates = [...templateMetadata.values()]
|
||||
.map((entry) => ({
|
||||
@@ -155,7 +171,7 @@ const templateCandidates = [...templateMetadata.values()]
|
||||
.sort((left, right) => left.templateId - right.templateId);
|
||||
|
||||
const bossRows = (snapshot.rows ?? [])
|
||||
.filter((row) => row.classification === "boss")
|
||||
.filter((row) => templatesById.get(row.templateId)?.classification === "boss")
|
||||
.map((row) => ({
|
||||
spawnId: row.spawnId,
|
||||
templateId: row.templateId,
|
||||
@@ -164,6 +180,26 @@ const bossRows = (snapshot.rows ?? [])
|
||||
autoPlot: clean(row.source?.autoPlot) || null,
|
||||
plotClassName: clean(row.source?.plotClassName) || null,
|
||||
}));
|
||||
const scriptedBossSpawns = (recipe.scriptedSpawns ?? [])
|
||||
.filter((spawn) => templatesById.get(spawn.templateId)?.classification === "boss")
|
||||
.map((spawn) => {
|
||||
const template = templatesById.get(spawn.templateId);
|
||||
const anchor = rowsBySpawnId.get(spawn.sourceAnchorSpawnId);
|
||||
const offset = spawn.sourceOffset ?? [0, 0, 0];
|
||||
return {
|
||||
scriptedPlacementId: spawn.id,
|
||||
sourceAnchorSpawnId: spawn.sourceAnchorSpawnId,
|
||||
controllerSpawnId: spawn.controllerSpawnId ?? null,
|
||||
templateId: spawn.templateId,
|
||||
name: template.name,
|
||||
sourcePosition: anchor
|
||||
? anchor.sourcePosition.map((value, index) => value + offset[index])
|
||||
: null,
|
||||
sourceScriptRoot: spawn.sourceScriptRoot ?? template.source?.scriptRoots?.[0] ?? null,
|
||||
objective: spawn.objective !== false,
|
||||
evidence: spawn.evidence,
|
||||
};
|
||||
});
|
||||
const categories = Object.fromEntries(SIGNALS.map(({ kind }) => [
|
||||
kind,
|
||||
luaSignals.filter((signal) => signal.kinds.includes(kind)).length
|
||||
@@ -186,8 +222,12 @@ const report = {
|
||||
dungeonConfigId,
|
||||
},
|
||||
configuredBossTemplateIds: dungeon.boss_guids ?? [],
|
||||
reviewedBossTemplateIds: recipe.templates
|
||||
.filter((template) => template.classification === "boss")
|
||||
.map((template) => template.id),
|
||||
configuredBossPositions: dungeon.boss_positions ?? {},
|
||||
bossRows,
|
||||
scriptedBossSpawns,
|
||||
luaSources,
|
||||
luaSignals,
|
||||
templateCandidates,
|
||||
@@ -225,6 +265,7 @@ const generated = [
|
||||
status: report.status,
|
||||
categories: report.categories,
|
||||
bossRows: report.bossRows,
|
||||
scriptedBossSpawns: report.scriptedBossSpawns,
|
||||
templateCandidates: report.templateCandidates,
|
||||
reviewQueue: report.reviewQueue,
|
||||
sourceReport: projectPath(reportFile),
|
||||
|
||||
Reference in new issue
Block a user