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; };
+6 -1
View File
@@ -94,15 +94,20 @@ test('shop / reward card: a mode-disabled bond tag is struck through with the
assert.ok(tags(null).every((v) => !hasClass(v, 'is-off')), 'no set: as before');
});
test('bond popup: 本局禁用 instead of 未激活, a note, and no misleading member count', () => {
test('bond popup: 本局禁用 instead of 未激活, a note, and no misleading member count or 当前效果 numbers', () => {
const pop = BondPopup({ bondId: 'arcaneShip', entry: null, priv: { board: [], hand: [] }, onClose() {}, off: true });
const text = textOf(pop);
assert.match(text, /本局禁用/);
assert.match(text, /本模式下该盟约不会激活/);
assert.doesNotMatch(text, /在场/);
// the 当前效果 block ("提升20% … 68%") would promise an effect the mode never gives; the bond text (盟约效果) stays
assert.doesNotMatch(text, /当前效果/);
assert.ok(![...walk(pop)].some((v) => hasClass(v, 'bpop__sec--now')), 'no current-effect section');
assert.match(text, /盟约效果/);
const plain = textOf(BondPopup({ bondId: 'arcaneShip', entry: null, priv: { board: [], hand: [] }, onClose() {} }));
assert.match(plain, /未激活/);
assert.match(plain, /在场/);
assert.match(plain, /当前效果/, 'an enabled bond keeps its current-effect block');
});
test('the game screen hands the mode-disabled set to the shop bar, the detail card and the bond popup', () => {