feedback7 R22-LATE: 画卷 never puts the copied items on the copy — they are gained unequipped into the hand / temp like any item; golden: unchanged
PRTS 卫戍协议:盟约 PRTS盟约记录, 法术编纂集, 画卷 备注: 「选择策略<夕>时可获得<br>使用后销毁,获得的装备为未装备状态」. Without a promotion the 画卷 handler still equipped every copied item that did not merge (an advanced item, a 变形同构体) onto the copy in the hand (the promotion case was fixed for #389). Now each copied item is only gained (ctx.grantItem → acquireItem): the hand, overflow temp, and with both full it is destroyed with the usual toast 「整备区已满,获得的装备已销毁」, as for any gained item. A copied normal item that completes a pair still merges at once (the golden in the hand), and the copy itself still follows the chess gain rules (a full hand and temp refuse the scroll: HAND_FULL, the scroll kept). Full-hand check: a full hand with 3 free temp slots holds the copy and both copied advanced items; with 2 free slots the copy and one item fit and the other is destroyed with the toast (before, both rode on the copy). Docs: META.md (Arts list), research/04-items.md (画卷 copy). The content test that pinned the old behaviour (test/content/items.test.js: 变形同构体 "the copy wears it too") now expects it in the hand. Tests: test/match/scroll-copy-merge.test.js +3 (no promotion, normal and elite targets with advanced items; the full hand at 3 / 2 free temp slots) — all 3 fail on the parent; every test mentioning 画卷: 177 pass. Golden unchanged.
This commit is contained in:
1 parent
7c56335c06
commit
ac4231846f
5 files changed
+56
-17
No files matched your search
@@ -111,3 +111,44 @@ test('Picture Scroll: a full hand and temp without promotion keeps the refused s
|
||||
assert.deepEqual(ps.privateView(), before);
|
||||
h.invariants();
|
||||
});
|
||||
|
||||
// PRTS 画卷 备注 「使用后销毁,获得的装备为未装备状态」: without a promotion too, the copied items are gained like any item —
|
||||
// the hand, overflow temp — and never put on the copy (until 0.2.2 a copy that did not merge was equipped onto it)
|
||||
const ADV = [HAMMER, SHIELD].map((id) => id.replace(/_a$/, '_b'));
|
||||
const looseItems = (ps) => [...ps.hand, ...ps.temp].filter((p) => p?.kind === 'item').map((p) => p.id).sort();
|
||||
for (const golden of [false, true]) {
|
||||
test(`Picture Scroll: one ${golden ? 'elite' : 'normal'} target — the copied (advanced) items arrive unequipped in the hand`, (t) => {
|
||||
const { h, m, ps, target, cast } = prep(t, { copies: 1, golden, items: ADV });
|
||||
assert.deepEqual(cast(), OK);
|
||||
const copy = ps.allChess().find((p) => p.id === target.id && p !== target);
|
||||
assert.ok(copy, 'the copy was gained');
|
||||
assert.deepEqual(copy.items, [], 'the copy wears nothing');
|
||||
assert.deepEqual(target.items.map((p) => p.id).sort(), [...ADV].sort(), 'the target keeps its own');
|
||||
assert.deepEqual(looseItems(ps), [...ADV].sort(), 'the copied items wait in the hand');
|
||||
assert.equal(m.gd.chess(copy.id).isGolden, golden);
|
||||
h.invariants();
|
||||
});
|
||||
}
|
||||
|
||||
test('Picture Scroll: a full hand — the copy and its items overflow into temp; an item with no slot left is destroyed like any gained item', (t) => {
|
||||
for (const free of [3, 2]) {
|
||||
const { h, ps, target, cast } = prep(t, { copies: 1, items: ADV });
|
||||
while (ps.hand.some((p) => p == null)) assert.ok(ps.acquireItem(FILLER));
|
||||
while (ps.temp.filter((p) => p == null).length > free) assert.ok(ps.acquireItem(FILLER));
|
||||
const toasts = () => h.allTo('p_0', 'm.toast').map((x) => JSON.stringify(x));
|
||||
const before = toasts().length;
|
||||
assert.deepEqual(cast(), OK);
|
||||
const copy = ps.allChess().find((p) => p.id === target.id && p !== target);
|
||||
const where = copy ? ps.find(copy.uid)?.area : null;
|
||||
assert.ok(where === 'temp' || where === 'hand', `free ${free}: the copy was gained into temp (the hand fills from temp once the scroll left)`);
|
||||
assert.deepEqual(copy.items, [], `free ${free}: the copy wears nothing`);
|
||||
assert.deepEqual(target.items.map((p) => p.id).sort(), [...ADV].sort());
|
||||
const got = looseItems(ps).filter((id) => id !== FILLER);
|
||||
if (free === 3) assert.deepEqual(got, [...ADV].sort(), 'room for the copy and both items');
|
||||
else {
|
||||
assert.equal(got.length, 1, 'room for the copy and one item: the other is destroyed');
|
||||
assert.ok(toasts().slice(before).some((s) => s.includes('整备区已满,获得的装备已销毁')), 'with the usual toast');
|
||||
}
|
||||
h.invariants();
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user