feedback1b WG: review fixes - off popup without 当前效果, destroyPiece merge test, 奥术 refresh noted

- The popup of a bond the mode never activates no longer shows the 当前效果
  block (its +20 % / +68 % promised an effect 本局禁用 denies); the bond
  text stays. The popup test asserts it.
- ctx.destroyPiece's auto-merge of returned equipment has its own test
  (constructed pair; fails without the call).
- SIM.md and the 奥术 header: an earlier PRTS revision (oldid 386936) forbade
  a unit re-applying while its own instance lasts; an equal hit here
  refreshes it - recorded as a known [ASSUMED] deviation, slightly stronger.
This commit is contained in:
sganggs committed 2026-10-03 03:08:03 +08:00
1 parent 8fa7a85a52
commit 695ece2653
5 files changed
+40 -12

No files matched your search

+17
View File
@@ -11,6 +11,7 @@ import assert from 'node:assert/strict';
import { DATA, makeMatch, give, giveItem, legalTileFor, checkInvariants } from './harness.js';
import { tileKey } from '../../server/match/board.js';
import { applyCard } from '../../server/match/choices.js';
import { makeCtx } from '../../server/match/effectsMeta.js';
const WHITE = 'chess_item_1_05_e_a';
const GOLD = 'chess_item_1_05_e_b';
@@ -134,6 +135,22 @@ test('a promotion that returns equipment merges a returned pair (latent: no norm
checkInvariants(m);
});
test('an effect that removes an operator (ctx.destroyPiece) merges a returned pair (latent: no normal state holds a pair)', () => {
const { m, ps } = prep();
const [a] = deploy(m, ps, [OP]);
// built directly: the carrier's white and a white in the hand — every entry path would have merged them at once
a.items = [ps.newPiece('item', WHITE)];
ps.hand[ps.hand.findIndex((x) => x == null)] = ps.newPiece('item', WHITE);
ps.recompute();
// the path of 突变细胞 / the recruit-and-gift item / the round-start promotion item (builtinMeta, content/items/meta.js)
const ctx = makeCtx(m, ps, { kind: 'item', key: 'item:test' }, 'onRoundStart');
assert.equal(ctx.destroyPiece(a.uid), true);
assert.equal(ps.find(a.uid), null, 'the operator is gone');
assert.deepEqual(count(ps), { white: 0, gold: 1 }, '"在失去该干员…" returns the equipment, then the auto-merge');
checkInvariants(m);
m.dispose();
});
test('random intents around 源石溶剂 (buy, equip / replace, sell, move, destroy) conserve W + 2·G and never leave a pair', () => {
let seed = 11;
const rnd = () => { seed = (seed * 1103515245 + 12345) >>> 0; return seed / 4294967296; };