fix(render): show Swire Alter coin balance

This commit is contained in:
IceCodeNew committed 2026-10-09 19:56:02 +00:00
1 parent 1db8e51023
commit 416e7d9e14
8 files changed
+140 -4

No files matched your search

+1
View File
@@ -1399,6 +1399,7 @@ Unknown subprofessions fall back to the profession default (test `professions.te
readouts of `snapshot.js` `ammoView` (an ally's running ammo skill: whole rounds, the magazine = `ammoMax`), `wolfView` (伺夜's 狼群:
`mem.shadows` of `mem.wolfCapacity`) and `negView` (`unit.negFill()`, set by 斩业星熊's T1 业火: the 我执 pool as a share of its cap);
UnitInfo `ammoSkill` marks an ally whose skill is an ammo magazine (DESIGN §8.2).
Optional `coins` carries 琳琅诗怀雅's balance; its wire and display contract is in [DESIGN §8.2](design/network.md#82-match).
`fieldMeta()` lists the knocked-out operators too (a client joining mid-battle shows them; DESIGN §18.3).
`stand: [[id, until]]` (only when non-empty) = the game time each enemy's attack recovery ends (`atkStandUntil`: it
stands for the rest of its attack clip, §1.2 `attackStand`) — enemies alive, deployed, visible, neither feared nor stunned;
+5
View File
@@ -38,6 +38,11 @@ S→C:
listed enemy's recovery was cut or ignored (失衡, fear, stun, hiding, leaving): an interval with a cut inside it stays
linear. A newest snapshot showing a death, a stun or a block is not extrapolated. Old snapshots without them
interpolate linearly; nothing is inferred from the attack animation.
- Optional `b.snap.coins: [[id, balance]]` carries 琳琅诗怀雅's whole-coin balance (`mem.coins`), including zero, for living,
deployed, visible allies. The client samples it at the older snapshot boundary, as with `wolves`; malformed rows and
unknown ids are ignored, and an absent entry clears the display. A coin icon and integer sit below HP/SP and above the
element gauge, hidden in prep and while down. The icon reuses the coin FX texture from `render/textures.js`.
[ASSUMED] HUD placement/style; no coin mechanics change.
- `b.ev` — `{ fieldId, ev: [ ... ] }` event tuples: `['spawn', UnitInfo]`, `['atk', srcId, tgtId, projKind]`, `['dmg', tgtId, amount, type]`, `['heal', tgtId, amount]`, `['skill', id, on:0|1]`, `['die', id, reason]` (reason `'killed'`, `'retreat'`, `'expired'` …; only `'killed'` plays an operator's knock-down sound), `['status', id, key, on]`, `['fx', kind, x, y, extra]` (`'hitCap' {id, n}` = a cancelled 限伤 hit, drawn as nothing, §20.12; `extra.form` = the unit's model form from then on (an enemy's mode, a 傀儡师's 替身 §22.11) — `shared/protocol.js fxForm`, state like a spawn: never dropped by the client, §21.4), `['layer', playerId, bondId, n]`, `['bounty', playerId, coins]`, `['deploy', id]`
- `m.toast {kind, text}` · `m.ticker {text, id, type, priority, playerId}` (the strip plays the highest priority first, §21.10) · `m.emote {playerId, id}` · `m.result {...}`
- `m.unitStats {seq, round, units: [unitStatsEntry]}` — the answer to `g.unitStats` (`seq` echoed): every own board operator / summon by uid with `{id, uid, defId, hp, alive, maxHp, atk, def, res, interval, blockCnt, moveSpeed, range?, base: {…same}}` and `dir?` (shared/protocol.js `unitStatsEntry`; `range` = an ally's live range grid, facing RIGHT, never a target-selection grid, §21.16; `dir` = the unit's facing now, UP|RIGHT|DOWN|LEFT — the snapshot tuples carry none and UnitInfo `dir` is the facing at send time — which the detail card's range overlay rotates by, GitHub PR #281) as its next battle starts (§18.5)
+4
View File
@@ -1060,6 +1060,10 @@ players alive when the fight starts; no change.)
我执), `test/render/hud-readouts.test.js` (14: interp stepping / malformed rows / absent list, the cells, the pips, the red bar, the
aura, and the chain sim → snapshot → buffer → view) — all fail on the parent; a headless-Chrome look at the real field view
(`notes/shot-hud.mjs`, not committed) shows the three readouts as intended. Docs: design/network.md, SIM.md §9, design/client.md, PLAYING.md, `types/core.js`.
- 琳琅诗怀雅's coin balance uses the same snapshot/readout path. A player screenshot showed her HP/SP bars without a coin
count; the kit already tracked `mem.coins`, but snapshots omitted it. The optional `coins` field supplies the HUD's
coin icon and integer, including zero ([DESIGN §8.2](../design/network.md#82-match)). The icon reuses the coin FX texture;
the inspected `entry/img_coin` is an event ticket, not her currency. [ASSUMED] placement/style; generation, spending and skills are unchanged.
### 27.43 A renderer that loses the 12 s race no longer mounts its canvas late — the attempt is aborted (PR #302 by @siruimei07) — `ui/fieldHost.js mountFieldView / useFieldView`, `render/app.js createFieldView`, `render/app/host.js withTimeout`
- **Seen**: `mountFieldView` raced `createFieldView` against a 12 s timeout and on failure removed every child of the host, but the factory