From 7b0feae9e9ab67ff26e5eb6f0040f8f95fed1b17 Mon Sep 17 00:00:00 2001 From: sganggs Date: Sat, 3 Oct 2026 06:54:34 +0800 Subject: [PATCH] =?UTF-8?q?feedback1=20integrate:=20test=20that=20?= =?UTF-8?q?=E7=BB=B4=E5=A8=9C=C2=B7=E7=BB=B4=E5=A4=9A=E5=88=A9=E4=BA=9A's?= =?UTF-8?q?=20S3=20lions=20never=20land=20in=20=E6=88=98=E5=9C=BA#08's=20?= =?UTF-8?q?=E6=B7=B1=E6=B0=B4=E5=8C=BA=20(WH=20x=20WC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/sim/feedback1-integrate.test.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/sim/feedback1-integrate.test.js b/test/sim/feedback1-integrate.test.js index 24911f3f..9162e0e2 100644 --- a/test/sim/feedback1-integrate.test.js +++ b/test/sim/feedback1-integrate.test.js @@ -2,6 +2,7 @@ import { test } from 'node:test'; import assert from 'node:assert/strict'; import { makeBattle, enemyRec, checkInvariants } from '../helpers/battleHarness.js'; +import { getDefaultSource } from '../../server/sim/simdata.js'; const dummy = (key, o = {}) => enemyRec({ key, hp: 1e7, speed: 0, ...o }); @@ -29,3 +30,29 @@ test('隐德来希 S3: candles still standing at the time limit are no leaks (th assert.deepEqual(h.b.errors.map((e) => e.message), []); checkInvariants(h.b); }); + +// WH (维娜·维多利亚 S3: a 黄金盟誓 on every free melee tile around her) × WC (战场#08's 深水区 refuses deployment): the +// lions go through grid.canStand, so none lands in the water — e.g. 维娜 on (9,5) skips (10,6). +test('维娜·维多利亚 S3 on 战场#08 (涨潮控制): no 黄金盟誓 in the 深水区', () => { + const VINA = 'chess_char_6_07_a', LION = 'token_10040_siege2_vlion', STAGE = 'act2autochess_m04'; + const st = getDefaultSource().getStage(STAGE); + const water = new Set(); + st.raw.rows.forEach((row, r) => [...row].forEach((ch, c) => { if (st.raw.tiles[ch]?.tileKey === 'tile_deepsea') water.add(`${r},${c}`); })); + assert.ok(water.has('10,6') && water.has('11,6') && water.has('12,6'), `the board's pool: ${[...water].join(' ')}`); + let lions = 0; + for (const [r, c] of [[9, 5], [11, 5], [10, 5], [10, 7], [11, 7]]) { + const h = makeBattle({ + stageId: STAGE, defs: { enemies: { e_d: dummy('e_d', { hp: 1e9 }) } }, + units: [{ chessId: VINA, row: r, col: c }], enemies: [{ key: 'e_d', pos: [r, c + 1] }], autoFinish: false, timeLimit: 30, + }); + h.step(); + const u = h.unit(VINA); + u.skill.gainSp(1000); + assert.ok(h.runUntil(() => u.skill.active, 8), `S3 at (${r},${c})`); + const placed = h.b.allyUnits.filter((a) => a.alive && a.defId === LION); + lions += placed.length; + for (const l of placed) assert.ok(!water.has(`${l.tileR},${l.tileC}`), `a lion of 维娜 (${r},${c}) in the water at (${l.tileR},${l.tileC})`); + checkInvariants(h.b); + } + assert.ok(lions >= 20, `${lions} lions placed`); +});