feedback1b WG: item merges re-checked; returned equipment auto-merges

Player report after 0.1.0: "源石溶剂两个白的合成一个金色的之后又多给一个白的".
Not reproduced: buying next to a white (hand / equipped), buying twice, equip
on another or a full carrier, reward pick, 道具补给, 列装, 整备, 画卷 and the
sale of a carrier all end with one golden and no white; random intents over
all 50 mergeable items conserve the white-equivalents and never leave a pair.

The one gap: equipment a promotion (PlayerState._mergeChess) or an effect
that removes an operator (ctx.destroyPiece) returns to the hand skipped the
auto-merge. Unreachable from a normal state (a pair never exists), closed:
both now run checkItemMerges.
This commit is contained in:
sganggs committed 2026-10-03 02:31:44 +08:00
1 parent b4fa21a0a6
commit 8fa7a85a52
4 files changed
+185 -2

No files matched your search

+4 -1
View File
@@ -477,7 +477,8 @@ export class PlayerState {
* 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 ("干员晋级后已配发装备会回收至整备区";
* overflow temp; with both full it stays on the elite, up to its equipPerChess (2) slots — any further item is
* destroyed with a log warning, as before the official rule); their summons are removed, and an elite on the board
* destroyed with a log warning, as before the official rule) and an identical normal pair among it merges like any gain
* (checkItemMerges); their summons are removed, and an elite on the board
* gets its own summon stack (grantTokensFor: its loadout, like any deployment). Returns the elite piece (or null if
* the elite could not be stored).
* @param {string} baseId
@@ -515,6 +516,8 @@ export class PlayerState {
if (where && elite.items.length < this.gd.equipPerChess) { elite.items.push(it); continue; }
this.m.log.warn?.(`[match ${this.m.roomCode}] ${this.playerId}: returned item ${it.id} destroyed (no space)`);
}
// the returned equipment follows the auto-merge rule like any other gain ("已拥有2件同一初始装备时…自动合并")
this.checkItemMerges();
// deployed like any operator placed by hand: its manually deployable summons join the hand (after the returned
// equipment, which would be lost in temp — a summon stack removed there comes back at the next round start)
if (where === 'board') this.grantTokensFor(elite);