feedback7 R22-LATE: a watched teammate's bond popup counts their bench like their own popup — hand operators owned (and counted for 投资人 / 远见 / 奇迹), temp ones never, neither 在场; golden: unchanged
GitHub #385 / PR #387 by @zasx77771. The prep scout sends the hand and the 临时整备区 as units, and ownerBoard put every op unit on the popup's synthetic board, so the popup marked bench operators 在场 and its 成员 header disagreed with the server's ring (炎: ring 1, header 3; 远见: ring 2, header 3 with the temp copy). The scout's units now carry `area` 'board' | 'hand' | 'temp' (the server tags from PR #387; the tag survives the boss-half remap, the row does not). ownerBoard sorts them into board / hand / temp instead of dropping the bench as the PR did: dropping the hand would break the bonds that count the 整备区 (投资人 / 远见 / 奇迹 — a hand-only 远见 member: ring 1, header 0). bondMembers / memberHeadCount then count exactly as the player's own popup: hand = owned and in hand, temp = owned only. A unit without an area (battles, older servers) stays on the board. Docs: PLAYING.md's 观看谁 paragraph (the bench is listed in prep); comments in bondStrip.js / game.js. Tests: test/ui/watch-bonds.test.js (36; 2 fail on the parent), test/match/prep-bench.test.js + feedback5-boss-pair-prep.test.js (area tags; 4 fail on the parent). Golden unchanged (views only).
This commit is contained in:
1 parent
19c7b26850
commit
2df1cf15bf
8 files changed
+80
-30
No files matched your search
@@ -56,6 +56,7 @@ test('a move of the partner reaches the player\'s m.private and a scout of eithe
|
||||
const h = bossPrep(4, 5102);
|
||||
const m = h.m;
|
||||
const b = place(h, 'p_1', chessOfTier(1)[1]);
|
||||
const held = give(m, h.ps('p_0'), chessOfTier(1)[2]); // into p_0's hand
|
||||
m.flush(true);
|
||||
// p_3 (eliminated) scouts p_0: the scout shows p_0's half and p_1's board on the other half
|
||||
h.ps('p_3').eliminate(13);
|
||||
@@ -63,6 +64,9 @@ test('a move of the partner reaches the player\'s m.private and a scout of eithe
|
||||
let scout = h.lastTo('p_3', 'm.field');
|
||||
assert.deepEqual([scout.kind, scout.side, scout.mate], ['boss', 'L', { playerId: 'p_1', side: 'R' }]);
|
||||
assert.ok(scout.units.some((u) => u.uid === b.piece.uid && u.x >= 10), 'the partner\'s piece on the right half');
|
||||
// the area tags survive the boss-half remap (the rows do not): the bond popup tells the bench from the board (GitHub #385)
|
||||
assert.equal(scout.units.find((u) => u.uid === b.piece.uid).area, 'board');
|
||||
assert.equal(scout.units.find((u) => u.uid === held.uid).area, 'hand', 'a held operator stays tagged as held');
|
||||
// p_1 moves its piece: p_0's m.private and p_3's scout of p_0 follow
|
||||
const ps1 = h.ps('p_1');
|
||||
const to = legalTileFor(m, ps1, b.piece.id, new Set([`${b.tile[0]},${b.tile[1]}`]));
|
||||
|
||||
@@ -37,6 +37,7 @@ test('#44 prep scout: held pieces are units on the hand row; deploying moves the
|
||||
const u = first.units.find((x) => x.uid === piece.uid);
|
||||
assert.ok(u, `${pid}: the held operator is a unit of the scout`);
|
||||
assert.deepEqual([u.x, u.y], [0, GEO.HAND_ROW], `${pid}: standing on the first hand slot`);
|
||||
assert.equal(u.area, 'hand', 'tagged with its area: the bond popup counts it as held, not in play (GitHub #385)');
|
||||
assert.equal(u.kind, 'op');
|
||||
assert.equal(u.items, undefined, 'no items equipped yet');
|
||||
}
|
||||
@@ -48,6 +49,7 @@ test('#44 prep scout: held pieces are units on the hand row; deploying moves the
|
||||
const last = h.lastTo('p_0', 'm.field');
|
||||
const u = last.units.find((x) => x.uid === piece.uid);
|
||||
assert.deepEqual([u.x, u.y], [c, r], 'deployed onto the watched board');
|
||||
assert.equal(u.area, 'board');
|
||||
assert.equal(last.units.some((x) => x.uid === piece.uid && x.y === GEO.HAND_ROW), false, 'and gone from the hand row');
|
||||
m.dispose();
|
||||
});
|
||||
@@ -74,6 +76,7 @@ test('#44 prep scout: a held item is a kind-item unit on the hand row; equipped
|
||||
assert.ok(iu, 'the held item is a unit of the scout');
|
||||
assert.equal(iu.kind, 'item');
|
||||
assert.equal(iu.y, GEO.HAND_ROW);
|
||||
assert.equal(iu.area, 'hand');
|
||||
// equip the item onto the operator (still in the hand): the operator's unit carries the item id
|
||||
assert.deepEqual(m.handle('p_1', { t: 'g.equip', itemUid: item.uid, targetUid: op.uid }), { ok: true });
|
||||
const after = h.lastTo('p_0', 'm.field');
|
||||
@@ -109,7 +112,10 @@ test("PR #129 review: moving a hand piece to another slot is a scout change (x f
|
||||
const first = h.lastTo('p_0', 'm.field');
|
||||
const tu = first.units.find((x) => x.uid === c.uid);
|
||||
assert.deepEqual([tu.x, tu.y], [GEO.TEMP_C0, GEO.TEMP_ROW], 'the temp piece scouts on the temp row (first slot, col 4)');
|
||||
assert.equal(first.units.find((x) => x.uid === a.uid).x, 0);
|
||||
assert.equal(tu.area, 'temp');
|
||||
const hu = first.units.find((x) => x.uid === a.uid);
|
||||
assert.equal(hu.x, 0);
|
||||
assert.equal(hu.area, 'hand');
|
||||
|
||||
// a hand piece moved to another slot keeps uid and id — the slot must be in the signature for the push to fire
|
||||
assert.deepEqual(m.handle('p_1', { t: 'g.move', uid: a.uid, to: { area: 'hand', idx: 3 } }), { ok: true });
|
||||
|
||||
Reference in new issue
Block a user