forked from phenom/healer-man
Release Healer Man 0.1.22
This commit is contained in:
1 parent
f6f2375145
commit
7f6001723a
144 files changed
+54107
-690
No files matched your search
@@ -7,6 +7,18 @@ import compressedCampaign from "./generated/dungeonCampaignCatalog.compressed";
|
||||
import { gunzipSync, strFromU8 } from "fflate";
|
||||
import { DEFAULT_DUNGEON_ID as DEFAULT_DUNGEON_KEY } from "./dungeonDefaults";
|
||||
import { withRunewakerEncounterContent } from "./runewakerEncounterCatalog";
|
||||
import { withWowEncounterContent } from "./wowEncounterContentCatalog";
|
||||
import { withWowProgressionObjectContent } from "./wowProgressionObjectContentCatalog";
|
||||
import { withAscensionCustomEncounterContent } from "./ascensionCustomEncounterCatalog";
|
||||
import { withWowWrathEncounterContent } from "./wowWrathEncounterContentCatalog";
|
||||
import { withWowClassicEncounterContent } from "./wowClassicEncounterContentCatalog";
|
||||
import { withWowTbcEncounterContent } from "./wowTbcEncounterContentCatalog";
|
||||
import { withWowWrathEncounterBatchTwoContent } from "./wowWrathEncounterBatchTwoCatalog";
|
||||
import { withWowWrathEncounterBatchThreeContent } from "./wowWrathEncounterBatchThreeCatalog";
|
||||
import { withWowVerifiedNoOpInstanceContent } from "./wowVerifiedNoOpInstanceCatalog";
|
||||
import { withWowClassicEncounterBatchTwo } from "./wowClassicEncounterBatchTwoCatalog";
|
||||
import { withWowClassicEncounterBatchThree } from "./wowClassicEncounterBatchThreeCatalog";
|
||||
import { withWowTbcEncounterBatchTwoContent } from "./wowTbcEncounterBatchTwoCatalog";
|
||||
|
||||
export { DEFAULT_DUNGEON_ID } from "./dungeonDefaults";
|
||||
|
||||
@@ -60,6 +72,45 @@ function enrichAuthoredDefinition(
|
||||
.filter(([, entity]) => entity.kind === "boss")
|
||||
.map(([id]) => id),
|
||||
);
|
||||
const authoredObjectiveByName = new Map(
|
||||
authored.objectiveOrder.map((objective) => [normalizedName(objective.name), objective.id]),
|
||||
);
|
||||
const generatedObjectiveAliases = new Map(
|
||||
generated.objectiveOrder.map((objective) => [
|
||||
objective.id,
|
||||
authoredObjectiveByName.get(normalizedName(objective.name)) ?? objective.id,
|
||||
]),
|
||||
);
|
||||
const authoredId = (id: string): string => generatedObjectiveAliases.get(id) ?? id;
|
||||
const remappedGeneratedEncounters = (generated.encounters ?? []).map((encounter) => (
|
||||
encounter.source?.scope !== "boss-progression"
|
||||
? encounter
|
||||
: {
|
||||
...encounter,
|
||||
rules: encounter.rules.map((rule) => ({
|
||||
...rule,
|
||||
trigger: rule.trigger.kind === "entities-dead"
|
||||
? { ...rule.trigger, entityIds: rule.trigger.entityIds.map(authoredId) }
|
||||
: rule.trigger.kind === "entity-death" || rule.trigger.kind === "entity-engaged"
|
||||
? { ...rule.trigger, entityId: authoredId(rule.trigger.entityId) }
|
||||
: rule.trigger,
|
||||
guards: rule.guards?.map((guard) => (
|
||||
guard.kind === "objective-complete"
|
||||
? { ...guard, objectiveId: authoredId(guard.objectiveId) }
|
||||
: guard
|
||||
)),
|
||||
actions: rule.actions.map((action) => {
|
||||
if (action.kind === "complete-objective") {
|
||||
return { ...action, objectiveId: authoredId(action.objectiveId) };
|
||||
}
|
||||
if (action.kind === "set-checkpoint") {
|
||||
return { ...action, checkpointId: authoredId(action.checkpointId) };
|
||||
}
|
||||
return action;
|
||||
}),
|
||||
})),
|
||||
}
|
||||
));
|
||||
return {
|
||||
...authored,
|
||||
entities: {
|
||||
@@ -76,6 +127,15 @@ function enrichAuthoredDefinition(
|
||||
pack.members.some((member) => authoredBossEntityIds.has(member.entityId))
|
||||
)),
|
||||
],
|
||||
encounters: [
|
||||
...remappedGeneratedEncounters,
|
||||
...(authored.encounters ?? []),
|
||||
],
|
||||
encounterSpawnGroups: [
|
||||
...(generated.encounterSpawnGroups ?? []),
|
||||
...(authored.encounterSpawnGroups ?? []),
|
||||
],
|
||||
serverGameObjects: generated.serverGameObjects,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -88,6 +148,31 @@ if (authoredWailingCaverns.id !== DEFAULT_DUNGEON_KEY) {
|
||||
throw new Error(`Default dungeon id mismatch: ${authoredWailingCaverns.id}`);
|
||||
}
|
||||
|
||||
const DUNGEON_CONTENT_ADAPTERS: readonly (
|
||||
(definition: DungeonDefinition) => DungeonDefinition
|
||||
)[] = Object.freeze([
|
||||
withWowEncounterContent,
|
||||
withWowClassicEncounterContent,
|
||||
withWowClassicEncounterBatchTwo,
|
||||
withWowClassicEncounterBatchThree,
|
||||
withWowVerifiedNoOpInstanceContent,
|
||||
withWowWrathEncounterContent,
|
||||
withWowWrathEncounterBatchTwoContent,
|
||||
withWowWrathEncounterBatchThreeContent,
|
||||
withWowProgressionObjectContent,
|
||||
withWowTbcEncounterContent,
|
||||
withWowTbcEncounterBatchTwoContent,
|
||||
withAscensionCustomEncounterContent,
|
||||
withRunewakerEncounterContent,
|
||||
]);
|
||||
|
||||
function applyDungeonContentAdapters(definition: DungeonDefinition): DungeonDefinition {
|
||||
return DUNGEON_CONTENT_ADAPTERS.reduce(
|
||||
(current, applyContent) => applyContent(current),
|
||||
definition,
|
||||
);
|
||||
}
|
||||
|
||||
const dungeonRegistryEntries: readonly (readonly [string, DungeonDefinition])[] = [
|
||||
[authoredWailingCaverns.id, authoredWailingCaverns],
|
||||
[FORSAKEN_ABBEY_DEFINITION.id, FORSAKEN_ABBEY_DEFINITION],
|
||||
@@ -99,7 +184,10 @@ const dungeonRegistryEntries: readonly (readonly [string, DungeonDefinition])[]
|
||||
|
||||
export const DUNGEON_REGISTRY: Readonly<Record<string, DungeonDefinition>> = Object.freeze(
|
||||
Object.fromEntries(dungeonRegistryEntries.map(
|
||||
([id, definition]) => [id, withRunewakerEncounterContent(definition)] as const,
|
||||
([id, definition]) => [
|
||||
id,
|
||||
applyDungeonContentAdapters(definition),
|
||||
] as const,
|
||||
)),
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user