feedback1 WA: return the Mutation Cell before summon cards; bots keep it

Review follow-ups for reports #1 and #4.

- transformChess: the returned equipment is stowed before the new operator's
  summon stack is granted (as in _mergeChess); when the transformation
  completes a merge, the carrier's equipment goes through _mergeChess, which
  also returns it before the elite's summons. A summon card no longer pushes
  the returned 突变细胞 into temp, where it would be lost at the deadline.
- bot: a 突变细胞 left in temp with a full hand gets a hand slot (sell the
  weakest single hand chess, else destroy the cheapest other hand item, else
  sell any hand chess) instead of being destroyed.
- 拉普兰德's per-piece counter key is module-prefixed; the re-bought copy
  case is marked [ASSUMED] in the code and docs/META.md.
- .dhint--rule gets a style; sources quote PRTS 卫戍协议/帮助 exactly
  ("在失去该干员(干员出售、销毁、合并等)…时自动卸除").
This commit is contained in:
sganggs committed 2026-10-03 02:28:39 +08:00
1 parent f8e35d5055
commit 85d8bd40b4
10 files changed
+154 -36

No files matched your search

+10 -5
View File
@@ -21,8 +21,9 @@
// of any tier (the text gives no tier cap); a bond without an available chess falls through to the next tied one.
// * [ASSUMED] 松果: the "免费特殊招募" is a free pick-one offer of `rewardOffer.count` (3) chess of the pool's tier.
// * 拉普兰德 SERVER_GAIN_BOND_LAYER_BY_REFRESH_CNT "若为本回合首次主动刷新": per copy — the first manual refresh this
// operator witnesses in the round (players' report after 0.1.0); an elite merged this round keeps its copies'
// count [ASSUMED]. "本回合每刷新过1次" (SERVER_ADD_REFRESH_CNT_MULTIPLIER_BOND_LAYER, 阿罗玛 / 安洁莉娜 / 售出时)
// operator witnesses in the round (players' report after 0.1.0); [ASSUMED] an elite merged this round keeps its
// copies' count, and a copy bought after selling one this round is a new copy (fires on its own first refresh).
// "本回合每刷新过1次" (SERVER_ADD_REFRESH_CNT_MULTIPLIER_BOND_LAYER, 阿罗玛 / 安洁莉娜 / 售出时)
// fires on another event and reads the player's refreshes of the round (roundStats), like 本回合每获得过 / 每花费.
import { metaBonds, frontPiece, behindPiece, distinctTiers } from '../support/meta.js';
@@ -196,14 +197,18 @@ H.SERVER_ADD_REFRESH_CNT_MULTIPLIER_BOND_LAYER = {
// refreshes this copy witnessed this round (board or hand), so a 拉普兰德 bought after the round's first refresh still
// fires on the next one (players' report after 0.1.0: "获得该干员后该回合的首次刷新" also stacks — the official behaviour;
// read as each trait instance counting its own SERVER_REFRESH_SHOP triggers against bb.refresh_cnt). A re-triggered trait
// (ev.trigger) is no manual refresh: it neither fires nor counts. The copies of an elite merged this round pass on their
// count [ASSUMED] (PlayerState.pieceRoundCount); a new copy (bought — after a sale too —, granted) starts at 0.
// (ev.trigger) is no manual refresh: it neither fires nor counts. A new copy (bought, granted) starts at 0. [ASSUMED]:
// the copies of an elite merged this round pass on their highest count (PlayerState.pieceRoundCount — no second trigger
// that round, conservative); a copy bought after selling one this round is a new copy — "获得该干员后" — and fires on its
// own first refresh (the server cannot tell it from any other copy; each such +4 costs her price + a refresh − the
// 1-fund refund, and needs her in the shop again).
const REFRESH_CNT_KEY = 'garrison:SERVER_GAIN_BOND_LAYER_BY_REFRESH_CNT:refreshes'; // per-piece counter (module-prefixed)
H.SERVER_GAIN_BOND_LAYER_BY_REFRESH_CNT = {
onRefresh(ctx, ev) {
if (ev && ev.trigger) return;
const { bb, bbStr, garrison, piece } = ctx.source;
if (!piece || !Number.isInteger(piece.uid) || piece.uid <= 0) return;
if (ctx.incPieceCounter(piece.uid, 'refreshes') !== num(bb.refresh_cnt, 1)) return;
if (ctx.incPieceCounter(piece.uid, REFRESH_CNT_KEY) !== num(bb.refresh_cnt, 1)) return;
addAll(ctx, ids(bbStr.bond), num(bb.layer), requireActiveOf(garrison));
},
};