Release v0.1.18 2026-07-19
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
import { createClassInventory } from "./healers";
|
||||
import { HOCKEY_PVP_GOAL_DAMAGE, HOCKEY_PVP_GOAL_Z, hockeyPvpBossAt } from "./hockeyHealingPvp";
|
||||
import { HOCKEY_PVP_BOSS_DAMAGE_MULTIPLIER, HOCKEY_PVP_GOAL_DAMAGE, HOCKEY_PVP_GOAL_Z, hockeyPvpBossAt, type HockeyPvpRemoteSnapshot } from "./hockeyHealingPvp";
|
||||
import { upcomingEncounterMechanic, useGameStore } from "./store";
|
||||
import { freshParty } from "./data";
|
||||
import { createDefaultGearProgress, GEAR_OWNER_ORDER, GEAR_SLOT_ORDER, MAX_GEAR_LEVEL } from "./progression/gear";
|
||||
@@ -42,6 +42,7 @@ describe("Healing Hockey PVP encounter integration", () => {
|
||||
expect(state.boss.id).toBe(hockeyPvpBossAt(MATCH.seed, 0));
|
||||
expect(state.hockeyPvpOpponent.boss.id).toBe(state.boss.id);
|
||||
expect(state.hockeyPvp.opponentName).toBe("CPU Aster");
|
||||
expect(state.difficultyDamageMultiplier).toBe(HOCKEY_PVP_BOSS_DAMAGE_MULTIPLIER);
|
||||
});
|
||||
|
||||
it("normalizes both parties to default base gear without changing saved upgrades", () => {
|
||||
@@ -170,13 +171,16 @@ describe("Healing Hockey PVP encounter integration", () => {
|
||||
expect(useGameStore.getState().boss.id).toBe(useGameStore.getState().hockeyPvpOpponent.boss.id);
|
||||
});
|
||||
|
||||
it("wins when opponent party falls", () => {
|
||||
it("wins when opponent companions fall while rival healer remains alive", () => {
|
||||
useGameStore.getState().startEncounter();
|
||||
useGameStore.getState().setActiveTab("map");
|
||||
useGameStore.setState((state) => ({
|
||||
hockeyPvpOpponent: {
|
||||
...state.hockeyPvpOpponent,
|
||||
party: state.hockeyPvpOpponent.party.map((member) => ({ ...member, hp: 0 })),
|
||||
party: state.hockeyPvpOpponent.party.map((member) => ({
|
||||
...member,
|
||||
hp: member.id === "aelia" ? member.hp : 0,
|
||||
})),
|
||||
},
|
||||
}));
|
||||
useGameStore.getState().tick(0.01);
|
||||
@@ -185,6 +189,60 @@ describe("Healing Hockey PVP encounter integration", () => {
|
||||
expect(useGameStore.getState().activeTab).toBe("combat");
|
||||
});
|
||||
|
||||
it("loses when local companions fall while healer remains alive", () => {
|
||||
useGameStore.getState().startEncounter();
|
||||
useGameStore.setState((state) => ({
|
||||
party: state.party.map((member) => ({
|
||||
...member,
|
||||
hp: member.id === "aelia" ? member.hp : 0,
|
||||
})),
|
||||
}));
|
||||
|
||||
useGameStore.getState().tick(0.01);
|
||||
expect(useGameStore.getState().party.find((member) => member.id === "aelia")?.hp).toBeGreaterThan(0);
|
||||
expect(useGameStore.getState().phase).toBe("defeat");
|
||||
expect(useGameStore.getState().hockeyPvp.status).toBe("lost");
|
||||
});
|
||||
|
||||
it("wins an online match when remote companions fall while rival healer remains alive", () => {
|
||||
useGameStore.getState().configureHealer(
|
||||
"priest",
|
||||
"Aelia",
|
||||
createClassInventory("priest"),
|
||||
[hockeyPvpBossAt(MATCH.seed, 0)],
|
||||
"hockey-healing-pvp",
|
||||
undefined,
|
||||
"initiate",
|
||||
{ ...MATCH, matchId: "online-match", role: "guest" },
|
||||
);
|
||||
useGameStore.getState().startEncounter();
|
||||
const state = useGameStore.getState();
|
||||
const snapshot: HockeyPvpRemoteSnapshot = {
|
||||
sequence: 1,
|
||||
time: state.time,
|
||||
party: state.hockeyPvpOpponent.party.map((member) => ({
|
||||
...member,
|
||||
hp: member.id === "aelia" ? member.hp : 0,
|
||||
})),
|
||||
partyPositions: structuredClone(state.hockeyPvpOpponent.partyPositions),
|
||||
boss: {
|
||||
id: state.hockeyPvpOpponent.boss.id,
|
||||
name: state.hockeyPvpOpponent.boss.name,
|
||||
hp: state.hockeyPvpOpponent.boss.hp,
|
||||
maxHp: state.hockeyPvpOpponent.boss.maxHp,
|
||||
},
|
||||
bossPosition: [...state.hockeyPvpOpponent.bossMotion.position],
|
||||
bossMode: state.hockeyPvpOpponent.bossMotion.mode,
|
||||
bossKills: 0,
|
||||
playerPosition: [...state.hockeyPvp.opponentPlayerPosition],
|
||||
aimDirection: [...state.hockeyPvp.opponentAimDirection],
|
||||
};
|
||||
|
||||
useGameStore.getState().applyHockeyPvpRemoteSnapshot(snapshot);
|
||||
expect(useGameStore.getState().phase).toBe("victory");
|
||||
expect(useGameStore.getState().hockeyPvp.status).toBe("won");
|
||||
});
|
||||
|
||||
it("keeps HUD mechanic data defined during instant boss replacement", () => {
|
||||
useGameStore.setState((state) => ({ boss: { ...state.boss, hp: 0 } }));
|
||||
expect(upcomingEncounterMechanic(useGameStore.getState())).toEqual({
|
||||
|
||||
Reference in New Issue
Block a user