updated some performance stuff
This commit is contained in:
@@ -9,6 +9,9 @@ import {
|
||||
bossDeathDespawnSeconds,
|
||||
bossDeathHoldSeconds,
|
||||
bossDeathOpacity,
|
||||
consumeBossIndicatorPatch,
|
||||
createBossIndicatorPatchState,
|
||||
updateBossIndicatorPatchState,
|
||||
} from "./bossDeathVisuals";
|
||||
|
||||
describe("boss death visuals", () => {
|
||||
@@ -25,6 +28,22 @@ describe("boss death visuals", () => {
|
||||
expect(advanceBossIndicatorOpacity(0.4, false, 1 / 60)).toBe(1);
|
||||
});
|
||||
|
||||
it("patches indicator meshes once per defeat, including a replacement boss", () => {
|
||||
let state = createBossIndicatorPatchState(false);
|
||||
expect(state.pending).toBe(false);
|
||||
|
||||
state = updateBossIndicatorPatchState(state, true);
|
||||
expect(state.pending).toBe(true);
|
||||
state = consumeBossIndicatorPatch(state);
|
||||
expect(state.pending).toBe(false);
|
||||
expect(updateBossIndicatorPatchState(state, true)).toBe(state);
|
||||
|
||||
state = updateBossIndicatorPatchState(state, false);
|
||||
expect(state.pending).toBe(false);
|
||||
state = updateBossIndicatorPatchState(state, true);
|
||||
expect(state.pending).toBe(true);
|
||||
});
|
||||
|
||||
it("holds the death pose for a few seconds, then fades the model", () => {
|
||||
expect(bossDeathOpacity(BOSS_DEATH_HOLD_SECONDS)).toBe(1);
|
||||
expect(bossDeathOpacity(BOSS_DEATH_HOLD_SECONDS + BOSS_DEATH_FADE_SECONDS / 2)).toBeCloseTo(0.5);
|
||||
|
||||
Reference in New Issue
Block a user