feedback5 R2: docs and comments follow the split — DESIGN §2 and META list server/match/match/ and server/match/player/ (the classes: constructor + method install), research 09 / 11 name the new homes (Match.watch in match/watch.js, the settle in match/settle.js, the facing changes in player/placement.js / items.js), code comments that pointed at moved code say where it lives now (shared constants, client bandDraft / observe / result / hud / teamPanel / underframe / game-mock, test comments); .git-blame-ignore-revs lists the two pure-move commits. DESIGN §17–§23 history citations, the "before" column and the proposal of research 11, tools/build-data.mjs (Match.js still exports BAND_TURN_SECONDS) and public/js/ui/gameLogic.js (in the client stream R5) are left as they are

This commit is contained in:
sganggs committed 2026-10-05 17:18:22 +08:00
1 parent 64443b4aab
commit d9750d8aba
19 files changed
+43 -25

No files matched your search

+9 -2
View File
@@ -56,8 +56,15 @@ server/
lobby.js rooms (4-letter codes), seats, host, AI seats, ready/start, reconnect tokens, room→Match wiring
data.js loads data/*.json once, builds indexes (getChess, getBond, …); frozen objects
match/
Match.js match state machine, timers, round loop, co-op orchestration, broadcasting views
PlayerState.js per-player economy/shop/hand/board/items/bonds/LP state + all prep-intent handlers
Match.js match state machine, timers, round loop, co-op orchestration, broadcasting views — the class:
the lobby⇄match interface (header), constructor + method install
match/ Match's methods by concern (platform, infra, messaging, views, watch, intents, pause, phases,
spDraft, prep, combat, clientCombat, reports, unitePhase, bossRounds, settle; shared constants
in common.js), installed on Match.prototype
PlayerState.js per-player economy/shop/hand/board/items/bonds/LP state + all prep-intent handlers — the class:
constructor + method install
player/ PlayerState's methods by concern (basics, pieces, acquire, economy, placement, items, prep,
round, views; common.js), installed on PlayerState.prototype
pool.js SharedPool (copies per base chess), banned/disabled bonds, odds & rolls
board.js placement legality, deploy cap, hand/temp management, merge detection & execution
bondsMeta.js bond member counting (BOARD / BOARD_AND_DECK / golden), activation tiers, persistent layers
+8 -1
View File
@@ -7,7 +7,14 @@ Normative contracts stay in DESIGN.md §6 and §8; this file documents the imple
```
server/match/
Match.js state machine, timers, round loop, co-op orchestration, views (the lobby⇄match interface is at the top)
PlayerState.js per-player economy / shop / hand / board / items / bonds / LP + every prep intent handler
— the class: constructor + method install
match/ Match's methods by concern: platform, infra, messaging, views, watch, intents, pause, phases,
spDraft (机变), prep, combat, clientCombat, reports, unitePhase (联防), bossRounds (Final Assault /
Hidden Core), settle; common.js (FLOW_TICKER_PRIORITY, DELAYS, BAND_TURN_SECONDS, re-exported by Match.js)
PlayerState.js per-player economy / shop / hand / board / items / bonds / LP + every prep intent handler — the class:
constructor + method install
player/ PlayerState's methods by concern: basics, pieces, acquire (gains, merges), economy (funds, layers,
the shop), placement (g.move), items, prep, round (lifecycle, battleInput), views; common.js
gamedata.js typed, defaulted view of data/*.json (config tunables with research defaults) + the balance layer
(data/tuning.json, §3.1)
pool.js SharedPool (copies per base chess, across players), per-match bans, copy-weighted rolls
+2 -2
View File
@@ -318,7 +318,7 @@ The public mirror (ArknightsAssets2 `cn`, `ui/emoticon/theme/[uc]<themeId>/icon/
- `g.move {uid, to:{area:'board',row,col}, dir}` with `dir ∈ 'UP'|'RIGHT'|'DOWN'|'LEFT'`; the server defaults to `'RIGHT'` when absent, for bots and old clients.
- `g.art {itemUid,row,col,dir}`.
- Broadcast `dir` in the board state (public and private views, snapshot `UnitInfo.dir`).
2. **`server/match/PlayerState.js`.**
2. **`server/match/PlayerState.js`** (the methods named here: `server/match/player/placement.js`, `items.js`).
- Store `piece.dir`, preserved across rounds.
- In `_moveChessToBoard` and `_moveTokenToBoard`, `if (occ === piece) return OK;` must become "update `piece.dir`, recompute, OK". This is the in-place re-orient.
- Swaps keep each piece's own dir.
@@ -363,7 +363,7 @@ The public mirror (ArknightsAssets2 `cn`, `ui/emoticon/theme/[uc]<themeId>/icon/
4. Prep: the same avatar → 前往查看 flow (read-only board + pen).
5. 联防 and FA fields: the ‹ › pill cycles LEFT half / 全景 / RIGHT half, with captions "你自己" / "👁 name#" / "全景". Non-helpers are auto-moved to the 联防 field as observers. In FA the other pair's field is not selectable.
6. Eliminated players: a dialog offers 继续观战 (auto-observe the first live field, free switching) or 退出.
7. `server/match/Match.js watch()` must enforce the same rules (prep: any teammate; combat: only if your own field finished; FA: own pair only; dead: anything).
7. `Match.watch()` (`server/match/match/watch.js`) must enforce the same rules (prep: any teammate; combat: only if your own field finished; FA: own pair only; dead: anything).
### 6.4 Combat computation model (user item 5, architecture) [proposal based on §3.2]
+1 -1
View File
@@ -220,7 +220,7 @@ line is lost rather than clamped.
- `shared/constants.js`: `BOND_LAYER_CAP = 999` and `BOSS_HIT_LIMIT = 300000` (0 / Infinity = off), plus
`layerGainRoom(before, n)` = min(n, cap − before), never negative.
- Layers: every writer clamps with it — `PlayerState.addLayers` (every prep-side gain: 特质, items, bands, 机变 cards,
bonds), the settle of the in-battle gains (`Match.js`), `Battle.addLayers` (the live in-battle copy, after the
bonds), the settle of the in-battle gains (`Match.settle`, `server/match/match/settle.js`), `Battle.addLayers` (the live in-battle copy, after the
`layerGain` hook, as the client's `AddBondCount`); a gain at the cap adds 0 (no onLayers, no 'layer' event, no hook),
so the per-N milestones (远见, 奇迹, 维多利亚 …) stop with the count; the client-result check (`fields.js`) bounds a
reported gain by the room left from the bond's starting layers; `invariants.js` flags a bond above the cap. The dev