Update Healer Man server
This commit is contained in:
1 parent
69809f7228
commit
ff20ab8779
101 files changed
+16713
-945
No files matched your search
@@ -1,4 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { beforeAll, describe, expect, it } from "vitest";
|
||||
import { abilitiesForClass, abilityAtLevel, preloadAbilityCatalogsForClasses } from "./abilityCatalog";
|
||||
import { WOW335_ABILITIES_BY_CLASS } from "./wow335AbilityCatalog";
|
||||
import {
|
||||
enemyNpcSourceSpellBlockMetadata,
|
||||
SPELL_ATTR0_CU_DIRECT_DAMAGE,
|
||||
@@ -8,10 +10,13 @@ import {
|
||||
} from "./enemyBlocking";
|
||||
import {
|
||||
enemyUtilityEffectsAfterBlock,
|
||||
enemyUtilitySpellBlockAbilityContract,
|
||||
enemyUtilitySpellBlockDisposition,
|
||||
enemyUtilitySpellBlockSourceContract,
|
||||
} from "./enemyUtilitySpellBlocking";
|
||||
|
||||
beforeAll(async () => { await preloadAbilityCatalogsForClasses(["warrior", "rogue"]); });
|
||||
|
||||
const sourceSpell = enemyNpcSourceSpellBlockMetadata(72, "wow335")!;
|
||||
const utilityEffects = [
|
||||
{ kind: "interrupt", lockoutMs: 6_000 },
|
||||
@@ -28,28 +33,80 @@ const baseInput = {
|
||||
};
|
||||
|
||||
describe("ordinary NPC utility spell full-hit blocking", () => {
|
||||
it("publishes the exact Shield Bash 72 signature and block-relevant metadata", () => {
|
||||
it("publishes the exact Shield Bash, Kick, and Pummel rank contracts", () => {
|
||||
expect(enemyUtilitySpellBlockSourceContract(72, "wow335")).toMatchObject({
|
||||
spellId: 72,
|
||||
sourceProfile: "wow335",
|
||||
spellId: 72, sourceProfile: "wow335", abilityId: "wow335-warrior-shield-bash",
|
||||
classId: "warrior", abilityName: "Shield Bash",
|
||||
spellDefense: {
|
||||
damageClass: SPELL_DAMAGE_CLASS_MELEE,
|
||||
schoolMask: SPELL_SCHOOL_MASK_NORMAL,
|
||||
attributes0: 327696,
|
||||
attributes3: 8,
|
||||
directDamageFromEffects: false,
|
||||
sourceProfile: "wow335",
|
||||
customAttributeEvidence: { knownMask: 131_328, value: 0 },
|
||||
damageClass: SPELL_DAMAGE_CLASS_MELEE, schoolMask: SPELL_SCHOOL_MASK_NORMAL,
|
||||
attributes0: 327696, attributes3: 8, directDamageFromEffects: false,
|
||||
sourceProfile: "wow335", customAttributeEvidence: { knownMask: 131_328, value: 0 },
|
||||
},
|
||||
dbcEffects: [
|
||||
{ index: 0, effectType: 68, mechanic: 26, targetA: 6, triggerSpellId: 0 },
|
||||
{ index: 1, effectType: 64, mechanic: 0, targetA: 6, triggerSpellId: 29_703 },
|
||||
{ index: 0, effectType: 68, auraType: 0, mechanic: 26, targetA: 6, targetB: 0, basePoints: 0, triggerSpellId: 0 },
|
||||
{ index: 1, effectType: 64, auraType: 0, mechanic: 0, targetA: 6, targetB: 0, basePoints: 0, triggerSpellId: 29_703 },
|
||||
],
|
||||
projectedEffects: [
|
||||
{ kind: "interrupt", lockoutMs: 6_000 },
|
||||
{ kind: "trigger-spell", spellId: 29_703 },
|
||||
],
|
||||
});
|
||||
expect(enemyUtilitySpellBlockSourceContract(1766, "wow335")).toMatchObject({
|
||||
spellId: 1766, abilityId: "rogue-kick", sourceAbilityId: "wow335-rogue-kick",
|
||||
classId: "rogue", abilityName: "Kick",
|
||||
dbcEffects: [
|
||||
{ index: 0, effectType: 68, auraType: 0, mechanic: 26, targetA: 6, targetB: 0, basePoints: 1, triggerSpellId: 0 },
|
||||
{ index: 1, effectType: 0, auraType: 0, mechanic: 0, targetA: 0, targetB: 0, basePoints: 0, triggerSpellId: 0 },
|
||||
],
|
||||
projectedEffects: [{ kind: "interrupt", lockoutMs: 5_000 }],
|
||||
});
|
||||
expect(enemyUtilitySpellBlockSourceContract(6552, "wow335")).toMatchObject({
|
||||
spellId: 6552, abilityId: "wow335-warrior-pummel", classId: "warrior", abilityName: "Pummel",
|
||||
dbcEffects: [
|
||||
{ index: 0, effectType: 68, auraType: 0, mechanic: 26, targetA: 6, targetB: 0, basePoints: 1, triggerSpellId: 0 },
|
||||
{ index: 1, effectType: 0, auraType: 0, mechanic: 0, targetA: 0, targetB: 0, basePoints: 0, triggerSpellId: 0 },
|
||||
],
|
||||
projectedEffects: [{ kind: "interrupt", lockoutMs: 4_000 }],
|
||||
});
|
||||
expect(enemyUtilitySpellBlockSourceContract(72, "ascension")).toBeUndefined();
|
||||
expect(enemyUtilitySpellBlockSourceContract(1_671, "wow335")).toBeUndefined();
|
||||
});
|
||||
|
||||
it("binds blockability to the actual selected playable ability and exact projected effects", () => {
|
||||
const cases = [
|
||||
{ classId: "warrior" as const, name: "Shield Bash", spellId: 72 },
|
||||
{ classId: "rogue" as const, name: "Kick", spellId: 1_766 },
|
||||
{ classId: "warrior" as const, name: "Pummel", spellId: 6_552 },
|
||||
];
|
||||
for (const item of cases) {
|
||||
const base = abilitiesForClass(item.classId).find((ability) => ability.name === item.name);
|
||||
expect(base, item.name).toBeDefined();
|
||||
const selected = abilityAtLevel(base!, 80);
|
||||
expect(selected.dbcSpellId, item.name).toBe(item.spellId);
|
||||
expect(selected.source, item.name).toBe("wow335-progression");
|
||||
expect(enemyUtilitySpellBlockAbilityContract(selected)?.spellId, JSON.stringify(selected)).toBe(item.spellId);
|
||||
}
|
||||
|
||||
const rawKick = WOW335_ABILITIES_BY_CLASS.rogue.find((ability) => ability.id === "wow335-rogue-kick");
|
||||
expect(rawKick).toBeDefined();
|
||||
expect(enemyUtilitySpellBlockAbilityContract(abilityAtLevel(rawKick!, 80))?.spellId).toBe(1_766);
|
||||
|
||||
const kick = abilityAtLevel(abilitiesForClass("rogue").find((ability) => ability.name === "Kick")!, 80);
|
||||
expect(enemyUtilitySpellBlockAbilityContract({ ...kick, id: "wrong-chain" })).toBeUndefined();
|
||||
expect(enemyUtilitySpellBlockAbilityContract({ ...kick, classId: "warrior" })).toBeUndefined();
|
||||
expect(enemyUtilitySpellBlockAbilityContract({ ...kick, source: "runewaker" })).toBeUndefined();
|
||||
expect(enemyUtilitySpellBlockAbilityContract({ ...kick, dbcSpellId: 6552 })).toBeUndefined();
|
||||
expect(enemyUtilitySpellBlockAbilityContract({ ...kick, effects: [
|
||||
...kick.effects, { kind: "status", status: "stun", durationMs: 1_000 },
|
||||
] })).toBeUndefined();
|
||||
expect(enemyUtilitySpellBlockAbilityContract({ ...kick, effects: [
|
||||
{ kind: "interrupt", lockoutMs: 4_000 },
|
||||
] })).toBeUndefined();
|
||||
expect(enemyUtilitySpellBlockAbilityContract({ ...kick, wowSpellDefense: {
|
||||
...kick.wowSpellDefense!, customAttributes: SPELL_ATTR0_CU_DIRECT_DAMAGE,
|
||||
} })).toBeUndefined();
|
||||
});
|
||||
|
||||
it("suppresses every utility effect after a resolved full block", () => {
|
||||
const disposition = enemyUtilitySpellBlockDisposition({ ...baseInput, outcome: "block" });
|
||||
const effectsToApply = enemyUtilityEffectsAfterBlock(utilityEffects, disposition);
|
||||
|
||||
Reference in new issue
Block a user