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
@@ -1,4 +1,8 @@
|
||||
import { spawnMatchesDifficulty, type StaticMobSpawnDefinition } from "./mobPopulation";
|
||||
import {
|
||||
spawnMatchesDifficulty,
|
||||
type MobPackDefinition,
|
||||
type StaticMobSpawnDefinition,
|
||||
} from "./mobPopulation";
|
||||
import type { DungeonEncounterSpawnGroupDefinition } from "./dungeonTypes";
|
||||
|
||||
export function activeEncounterSpawnGroupSpawns(
|
||||
@@ -20,3 +24,24 @@ export function activeEncounterSpawnGroupSpawns(
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
export function suppressCompletedDungeonPopulation(
|
||||
staticSpawns: readonly StaticMobSpawnDefinition[],
|
||||
roamingPacks: readonly MobPackDefinition[],
|
||||
completedObjectiveIds: readonly string[],
|
||||
): {
|
||||
readonly staticSpawns: readonly StaticMobSpawnDefinition[];
|
||||
readonly roamingPacks: readonly MobPackDefinition[];
|
||||
} {
|
||||
if (!completedObjectiveIds.length) return { staticSpawns, roamingPacks };
|
||||
const completed = new Set(completedObjectiveIds);
|
||||
return {
|
||||
staticSpawns: staticSpawns.filter((spawn) => !completed.has(spawn.id)),
|
||||
roamingPacks: roamingPacks.flatMap((pack) => {
|
||||
const members = pack.members.filter(
|
||||
(member) => !completed.has(`${pack.id}:${member.id}`),
|
||||
);
|
||||
return members.length ? [{ ...pack, members }] : [];
|
||||
}),
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user