feedback3 WF: the initial deployment goes by column — the left column first, top to bottom within a column (PRTS 从上到下>从左到右 read as a scan, the 阿戈尔 devour's order; mirrored boss side from its own left); a merge's elite among several deployed copies follows it (server and client); tests whose target was the latest deployed keep it
This commit is contained in:
1 parent
0e3429aa1f
commit
ca3d0572ad
25 files changed
+94
-69
No files matched your search
@@ -321,7 +321,7 @@ export class PlayerState {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Every owned chess piece: board (deploy order) then hand then temp. */
|
||||
/** Every owned chess piece: board (reading order, board.js boardOrder) then hand then temp. */
|
||||
allChess() {
|
||||
const out = [];
|
||||
for (const { piece } of boardOrder(this.board)) if (piece.kind === 'chess') out.push(piece);
|
||||
@@ -509,8 +509,8 @@ export class PlayerState {
|
||||
* Merge `need` normal copies of `baseId` (the incoming, not yet stowed piece first, then temp, hand, board) into
|
||||
* the elite — PRTS 卫戍协议/帮助 §干员的获得与精锐化: "发送1名【精锐】状态的该干员至手牌区(若消耗已部署至作战区的干员,
|
||||
* 则发送至作战区对应位置)" (the user's playtest #6 follow-up confirms it). The tile (`mergeTile`): when a consumed copy
|
||||
* stood on the board the elite takes its tile and facing — of several, the one that deploys first (board reading
|
||||
* order: top → bottom, then left → right) [ASSUMED]. The incoming copy is never deployed (a 突变细胞 transformation
|
||||
* stood on the board the elite takes its tile and facing — of several, the one that deploys first (the left board
|
||||
* column first, top to bottom within a column — Battle.start's order) [ASSUMED]. The incoming copy is never deployed (a 突变细胞 transformation
|
||||
* destroyed its carrier before the gain: that tile is no copy's). It replaces a deployed copy, so the deploy count
|
||||
* never grows. Otherwise the elite goes to the hand, overflow temp — outside PREP too (a SETTLE merge's elite waits in
|
||||
* temp through the next prep, tempDue). The copies' equipment returns to the hand ("干员晋级后已配发装备会回收至整备区";
|
||||
|
||||
+10
-5
@@ -188,7 +188,11 @@ export function legalTiles(map, pos) {
|
||||
return out;
|
||||
}
|
||||
|
||||
/** Board pieces sorted in deployment order: top→bottom (row desc) then left→right (col asc). */
|
||||
/**
|
||||
* Board pieces in reading order: top row first (row desc), left to right within a row (col asc) — the battle input's order
|
||||
* (unit ids), the garrisons' dispatch order and the lists the views send. Not the deployment order: the battle deploys by
|
||||
* column (Battle.start; mergeTile follows that one).
|
||||
*/
|
||||
export function boardOrder(board) {
|
||||
return [...board.entries()]
|
||||
.map(([k, p]) => { const [r, c] = parseKey(k); return { r, c, piece: p }; })
|
||||
@@ -197,16 +201,17 @@ export function boardOrder(board) {
|
||||
|
||||
/**
|
||||
* Where a merge's elite stands (PRTS 卫戍协议/帮助 "若消耗已部署至作战区的干员,则发送至作战区对应位置"): of the board tiles
|
||||
* the consumed copies stood on (`[{ key, dir }]`), the first in deployment order (top→bottom, left→right — the copy the
|
||||
* battle deploys first; the right-hand boss half is mirrored on screen but deploys in the same board order) that
|
||||
* `legal(r, c)` accepts for the elite, or null (⇒ the hand). [ASSUMED] the order: the official text names one position.
|
||||
* the consumed copies stood on (`[{ key, dir }]`), the first in deployment order (the left board column first, top to
|
||||
* bottom within a column — the copy the battle deploys first, Battle.start; the right-hand boss half is mirrored on
|
||||
* screen but deploys in the same board order) that `legal(r, c)` accepts for the elite, or null (⇒ the hand). [ASSUMED]
|
||||
* the order: the official text names one position. Until 0.1.3 the deployment order, and so this one, was top row first.
|
||||
* public/js/ui/gameLogic.js mergeTarget mirrors it for the client.
|
||||
* @param {Array<{ key: string, dir?: string }>} tiles
|
||||
* @param {(r: number, c: number) => boolean} [legal]
|
||||
* @returns {{ key: string, dir?: string, r: number, c: number } | null}
|
||||
*/
|
||||
export function mergeTile(tiles, legal = () => true) {
|
||||
const sorted = (tiles || []).map((t) => { const [r, c] = parseKey(t.key); return { ...t, r, c }; }).sort((a, b) => b.r - a.r || a.c - b.c);
|
||||
const sorted = (tiles || []).map((t) => { const [r, c] = parseKey(t.key); return { ...t, r, c }; }).sort((a, b) => a.c - b.c || b.r - a.r);
|
||||
return sorted.find((t) => inField(t.r, t.c) && legal(t.r, t.c)) || null;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user