feat: refine exploration presentation and audio flow
This commit is contained in:
@@ -296,6 +296,8 @@ try {
|
||||
|
||||
const jianYong = actorById(exploration, 'jian-yong');
|
||||
const clickStart = { ...exploration.player };
|
||||
const autoInteractionCountBefore =
|
||||
exploration.movement.autoInteraction.triggeredCount;
|
||||
await clickScenePoint(page, jianYong.x, jianYong.y);
|
||||
await page.waitForFunction(
|
||||
({ key, actorId, startX, startY }) => {
|
||||
@@ -333,6 +335,14 @@ try {
|
||||
{ key: sceneKey, actorId: 'jian-yong' },
|
||||
{ timeout: 30000 }
|
||||
);
|
||||
await page.waitForFunction(
|
||||
(key) => (
|
||||
window.__HEROS_DEBUG__
|
||||
?.scene(key)
|
||||
?.getDebugState?.()?.dialogue?.sourceNpcId === 'jian-yong'
|
||||
),
|
||||
sceneKey
|
||||
);
|
||||
exploration = await readExploration(page);
|
||||
assert(
|
||||
actorById(exploration, 'jian-yong').distance <=
|
||||
@@ -340,19 +350,30 @@ try {
|
||||
`Click movement must stop inside Jian Yong's interaction radius: ${JSON.stringify(exploration.interaction)}`
|
||||
);
|
||||
assertActorsFixed(exploration, 'after click navigation');
|
||||
|
||||
await page.keyboard.press('e');
|
||||
await page.waitForFunction(
|
||||
(key) => {
|
||||
const state = window.__HEROS_DEBUG__
|
||||
?.scene(key)
|
||||
?.getDebugState?.();
|
||||
return (
|
||||
state?.dialogue?.active === true &&
|
||||
state.dialogue.sourceNpcId === 'jian-yong'
|
||||
);
|
||||
},
|
||||
sceneKey
|
||||
assert.equal(
|
||||
exploration.movement.autoInteraction.triggeredCount,
|
||||
autoInteractionCountBefore + 1,
|
||||
'Arriving at Jian Yong must open dialogue exactly once.'
|
||||
);
|
||||
const protectedArrivalLineIndex = exploration.dialogue.lineIndex;
|
||||
await page.mouse.click(960, 850);
|
||||
await page.waitForTimeout(80);
|
||||
exploration = await readExploration(page);
|
||||
assert.equal(
|
||||
exploration.dialogue.lineIndex,
|
||||
protectedArrivalLineIndex,
|
||||
'A follow-up click inside the arrival guard must not skip Jian Yong’s first line.'
|
||||
);
|
||||
assert.equal(
|
||||
exploration.dialogue.sourceNpcId,
|
||||
'jian-yong',
|
||||
'The arrival guard must keep Jian Yong’s newly opened dialogue active.'
|
||||
);
|
||||
await page.waitForTimeout(160);
|
||||
assert.equal(
|
||||
(await readExploration(page)).movement.autoInteraction.triggeredCount,
|
||||
autoInteractionCountBefore + 1,
|
||||
'Jian Yong dialogue must not retrigger on a later update.'
|
||||
);
|
||||
exploration = await readExploration(page);
|
||||
assert.equal(exploration.dialogue.speaker, '간옹');
|
||||
|
||||
Reference in New Issue
Block a user