From 47df17171ab50790248e7c45f623dcc97cb03cc0 Mon Sep 17 00:00:00 2001 From: sganggs Date: Sat, 3 Oct 2026 22:41:03 +0800 Subject: [PATCH] =?UTF-8?q?feedback2:=20test=20that=20=E7=BC=AA=E5=B0=94?= =?UTF-8?q?=E8=B5=9B=E6=80=9D=20wearing=20=E5=8F=98=E5=BD=A2=E5=90=8C?= =?UTF-8?q?=E6=9E=84=E4=BD=93=20+=20=E7=BB=B4=E5=BC=8F=E9=87=8D=E9=94=A4?= =?UTF-8?q?=20counts=20twice=20for=20=E7=BB=B4=E5=A4=9A=E5=88=A9=E4=BA=9A?= =?UTF-8?q?=20(case=20from=20PR=20#40=20by=20@shanzhaikabi)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/match/merge.test.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/match/merge.test.js b/test/match/merge.test.js index d1a995f7..fc52d78c 100644 --- a/test/match/merge.test.js +++ b/test/match/merge.test.js @@ -220,6 +220,27 @@ test('变形同构体 grants the bond of the other equipped item (bond counting) m.dispose(); }); +// The 调和 operator herself as the wearer (case from PR #40 by @shanzhaikabi; GitHub issue #1): the granted membership +// counts once and, 维多利亚 being a core bond with a member on the board, 调和 adds its +1 (bondsMeta `harmony`). +test('缪尔赛思 wearing 变形同构体 + 维式重锤 counts twice for 维多利亚: the granted member + 调和\'s +1', () => { + const MIRA = 'chess_char_6_11_a'; // 缪尔赛思: own bond 调和 (maniShip, thresholds [1]) + const { m, ps } = prep(28); + const tile = legalTileFor(m, ps, MIRA); + assert.ok(tile, 'a legal tile for 缪尔赛思'); + const mira = give(m, ps, MIRA, 'board', tile); + const iso = giveItem(m, ps, 'chess_item_6_09_e_a'); + const hammer = giveItem(m, ps, 'chess_item_1_01_e_a'); + assert.equal(ps.bonds.maniShip.active, true, '调和 is active with one 调和 operator on the board'); + assert.equal(ps.bonds.victoriaShip?.count ?? 0, 0, 'no 维多利亚 member before the second item'); + m.handle('p_0', { t: 'g.equip', itemUid: iso.uid, targetUid: mira.uid }); + m.handle('p_0', { t: 'g.equip', itemUid: hammer.uid, targetUid: mira.uid }); + assert.equal(ps.bonds.victoriaShip.count, 2, 'one from the granted membership, one from 调和'); + assert.equal(ps.bonds.victoriaShip.harmony, 1, 'the state says which +1 came from 调和'); + assert.equal(ps.bonds.victoriaShip.active, false, 'tier 1 still needs 3'); + checkInvariants(m); + m.dispose(); +}); + test('consume-on-equip built-ins: 盟约之币 funds, 随身身份牌 layers, 人事部文档 cap 9, 博士投影 promote; Arts limit', () => { const { m, ps } = prep(27); const id = chessOfTier(2).find((c) => m.pool.has(c));