forked from phenom/healer-man
Release Healer Man 0.1.30
This commit is contained in:
1 parent
544c1bee91
commit
7d7fd567f0
845 files changed
+2040
-87
No files matched your search
@@ -1,5 +1,8 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { abilityById } from "./abilityCatalog";
|
||||
import { WOW335_ABILITIES_BY_CLASS } from "./wow335AbilityCatalog";
|
||||
import {
|
||||
DEFAULT_COMBAT_PRESENTATION_SETTINGS,
|
||||
combatEffectManifestEntry,
|
||||
@@ -12,6 +15,8 @@ import {
|
||||
presentationSchoolForAbility,
|
||||
resetCombatPresentationSession,
|
||||
subscribeCombatPresentation,
|
||||
type CombatEffectManifestEntry,
|
||||
type CombatPresentationPhase,
|
||||
type CombatPresentationMessage,
|
||||
} from "./combatPresentation";
|
||||
|
||||
@@ -134,4 +139,45 @@ describe("combat presentation", () => {
|
||||
]);
|
||||
expect(originalCombatPhaseAssets(entry, "release")).toEqual([]);
|
||||
});
|
||||
|
||||
it("keeps every source-backed instant WoW rank on a renderable phase", () => {
|
||||
const manifest = JSON.parse(readFileSync(
|
||||
path.resolve("public/assets/game/combat-effects/manifest.json"),
|
||||
"utf8",
|
||||
)) as { readonly entries: readonly CombatEffectManifestEntry[] };
|
||||
const entriesBySpellId = new Map(manifest.entries
|
||||
.filter((entry) => entry.source === "wow335")
|
||||
.map((entry) => [entry.spellId, entry]));
|
||||
const reachablePhases: readonly CombatPresentationPhase[] = [
|
||||
"cast-start",
|
||||
"release",
|
||||
"impact",
|
||||
"aura-start",
|
||||
];
|
||||
const sourceBackedInstantRanks = Object.entries(WOW335_ABILITIES_BY_CLASS)
|
||||
.flatMap(([classId, abilities]) => abilities
|
||||
.flatMap((ability) => (ability.ranks ?? []).map((rank) => ({ ability, classId, rank }))))
|
||||
.filter(({ rank }) => rank.castMode === "instant")
|
||||
.flatMap(({ ability, classId, rank }) => {
|
||||
const entry = entriesBySpellId.get(rank.spellId);
|
||||
if (!entry) return [];
|
||||
const hasOriginal = Object.keys(entry.phases ?? {}).some((phase) => (
|
||||
originalCombatPhaseAssets(entry, phase as CombatPresentationPhase).length > 0
|
||||
));
|
||||
return hasOriginal ? [{
|
||||
abilityId: ability.id,
|
||||
classId,
|
||||
spellId: rank.spellId,
|
||||
entry,
|
||||
}] : [];
|
||||
});
|
||||
const unreachable = sourceBackedInstantRanks.filter(({ entry }) => (
|
||||
!reachablePhases.some((phase) => originalCombatPhaseAssets(entry, phase).length > 0)
|
||||
));
|
||||
|
||||
expect(unreachable.map(({ abilityId, spellId }) => `${abilityId}:${spellId}`)).toEqual([]);
|
||||
expect([...new Set(sourceBackedInstantRanks.map(({ classId }) => classId))].sort())
|
||||
.toEqual(Object.keys(WOW335_ABILITIES_BY_CLASS).sort());
|
||||
expect(sourceBackedInstantRanks.length).toBeGreaterThan(1_000);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user