From d355781b0187a06d81abb7f1f79deb330154c242 Mon Sep 17 00:00:00 2001 From: sganggs Date: Mon, 5 Oct 2026 22:44:17 +0800 Subject: [PATCH] =?UTF-8?q?feedback4:=20the=20#160=20skill-window=20test?= =?UTF-8?q?=20follows=20#109=20=E2=80=94=20a=20deploy-timed=20skill=20(?= =?UTF-8?q?=E7=BC=84=E9=BB=98=E5=BE=B7=E5=85=8B=E8=90=A8=E6=96=AF=20S2)=20?= =?UTF-8?q?is=20a=20duration=20skill=20with=20its=20own=20start=20/=20end?= =?UTF-8?q?=20events=20and=20one=20charge=20per=20deployment=20(each=20PR?= =?UTF-8?q?=20passed=20CI=20alone;=20together=20the=20old=20'no=20window?= =?UTF-8?q?=20for=20a=20timed=20passive'=20expectation=20was=20stale)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/sim/skills.test.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/test/sim/skills.test.js b/test/sim/skills.test.js index b1508e30..de2a64f3 100644 --- a/test/sim/skills.test.js +++ b/test/sim/skills.test.js @@ -434,7 +434,7 @@ test('spCostMul changes (绝技-style) keep SP within bounds and convert overflo assert.ok(u.skill.sp <= u.skill.spCost); }); -test('a deploy-time passive fires the skill animation window; a passive with a duration does not (yet)', () => { +test('a deploy-time passive fires the skill animation window; a deploy-timed skill runs its duration (PR #109)', () => { // 琳琅诗怀雅 S1 仗义疏财 / S2 “见面礼”: kind 'passive', no duration — the sim used to start them silently, so the // client got no 'skill' event and never played the clip the manifest carries (player report follow-up). The window is // the same one an instant cast uses: on at the deployment, off 0.5 s later (SKILL_ANIM_WINDOW), the passive itself @@ -450,11 +450,16 @@ test('a deploy-time passive fires the skill animation window; a passive with a d assert.deepEqual(h.eventsOf('skill').map((e) => e[2]), [1, 0], 'and closes 0.5 s later'); assert.equal(u.skill.active, true, 'the passive itself never ends'); - // a passive WITH a duration (缄默德克萨斯 S2 阵雨连绵, 8 s): left alone — the sim holds it active until death, so how - // long its stance should show is a separate question + // a deploy-timed skill (缄默德克萨斯 S2 阵雨连绵, 8 s) is a real duration skill since PR #109: on at the deployment + // (its own skill event, no 0.5 s window), off when the duration runs out, not ready again in that deployment const t = makeBattle({ units: [{ chessId: 'chess_char_4_16_a', row: 10, col: 6, skillIndex: 1 }], autoFinish: false, timeLimit: 30 }); t.run(0.6); - assert.equal(t.unit('chess_char_4_16_a').skill.kind, 'passive'); - assert.equal(t.unit('chess_char_4_16_a').skill.active, true); - assert.deepEqual(t.eventsOf('skill'), [], 'no window for a timed passive'); + const tx = t.unit('chess_char_4_16_a'); + assert.equal(tx.skill.kind, 'duration'); + assert.equal(tx.skill.active, true); + assert.deepEqual(t.eventsOf('skill').map((e) => e[2]), [1], 'on at the deployment'); + t.run(12); + assert.equal(tx.skill.active, false, 'the duration ran out'); + assert.deepEqual(t.eventsOf('skill').map((e) => e[2]), [1, 0], 'and the skill ended'); + assert.equal(tx.skill.ready, false, 'one charge per deployment'); });