feedback5 WY: 拟态物质 with 2 copies owned and none left in the pool gives nothing instead of a random same-bond operator (GitHub #207)
The item text 「若已拥有至少2名该初始干员,则再获得1名该初始干员;否则随机获得1名同盟约初始干员」: the 否则 is the case of fewer than 2 owned. builtinMeta's use_equip_reward_char_chess returned only when grantChess(base) gave a piece, so an elite 溯光星源 plus 2 normal copies (all 5 Ⅵ阶 copies) fell through to the same-bond roll (白面鸮 in the report's seed). Now with 2 owned it asks for the 3rd and stops; the item is still consumed. The bots' carrier choice (itemTarget) skips 2 copies whose pool is out. Tests: test/content/items.test.js (the report with the normal and golden item; 2 copies with the pool drained; 2 copies with copies left still merge), test/match/bot-smarter.test.js (no carrier on a pair whose pool is out); both fail without the fix. Docs: META built-ins and bot items, research 04 / 06, DESIGN §25.13.1. Golden unchanged.
This commit is contained in:
1 parent
e1ffcd1b07
commit
463352d9bc
8 files changed
+92
-11
No files matched your search
@@ -944,6 +944,49 @@ test('拟态物质: owning 2 copies gives the 3rd (→ elite); otherwise a rando
|
||||
cover(A('5_05'), B('5_05'));
|
||||
});
|
||||
|
||||
test('拟态物质 with 2 copies owned and none left in the pool gives nothing — never a same-bond operator; with copies left the 3rd still merges (GitHub #207)', () => {
|
||||
// the report: an elite 溯光星源 (3 of the Ⅵ阶's 5 copies) and 2 normal ones — the pool is empty, the item text's 否则
|
||||
// (a random same-bond operator) is only for fewer than 2 owned
|
||||
const cid = 'chess_char_6_16_a';
|
||||
const elite = DATA.chess[cid].goldenId;
|
||||
const chessIn = (ps) => [...ps.board.values(), ...ps.hand, ...ps.temp].filter((p) => p && p.kind === 'chess').map((p) => p.id).sort();
|
||||
for (const item of [A('5_05'), B('5_05')]) {
|
||||
const { m, ps, equip } = setup({ seed: 9 });
|
||||
give(m, ps, elite, 'hand');
|
||||
const t = give(m, ps, cid, 'hand');
|
||||
give(m, ps, cid, 'hand');
|
||||
assert.equal(m.pool.left(cid), 0, 'elite 3 + 2 normal = the pool cap 5');
|
||||
const before = chessIn(ps);
|
||||
const got = spyGrants(ps);
|
||||
const it = giveItem(m, ps, item);
|
||||
assert.deepEqual(equip(it, t), OK, item);
|
||||
assert.deepEqual(got, [], `${item}: nothing granted`);
|
||||
assert.deepEqual(chessIn(ps), before, `${item}: no other operator, no second elite`);
|
||||
assert.ok(!ps.find(it.uid), `${item}: consumed`);
|
||||
}
|
||||
// 2 normal copies, no elite, the pool drained by other players: nothing either
|
||||
{
|
||||
const { m, ps, equip } = setup({ seed: 9 });
|
||||
const t = give(m, ps, cid, 'hand');
|
||||
give(m, ps, cid, 'hand');
|
||||
m.pool.take(cid, m.pool.left(cid));
|
||||
const got = spyGrants(ps);
|
||||
assert.deepEqual(equip(giveItem(m, ps, A('5_05')), t), OK);
|
||||
assert.deepEqual(got, []);
|
||||
assert.deepEqual(chessIn(ps), [cid, cid]);
|
||||
}
|
||||
// 2 normal copies with copies left: the 3rd merges into the elite
|
||||
{
|
||||
const { m, ps, equip } = setup({ seed: 9 });
|
||||
const t = give(m, ps, cid, 'hand');
|
||||
give(m, ps, cid, 'hand');
|
||||
assert.equal(m.pool.left(cid), 3);
|
||||
assert.deepEqual(equip(giveItem(m, ps, A('5_05')), t), OK);
|
||||
assert.deepEqual(chessIn(ps), [elite]);
|
||||
assert.equal(m.pool.left(cid), 2, 'the elite holds 3 copies');
|
||||
}
|
||||
});
|
||||
|
||||
test('博士投影: golden promotes at once; normal stays equipped and promotes at the next round start', () => {
|
||||
const { h, m, ps, equip } = setup();
|
||||
const cid = plain((c) => c.tier === 2)[0];
|
||||
|
||||
@@ -108,6 +108,10 @@ test('items: 信标 on a bench single; both 博士投影 on a normal operator ev
|
||||
// 拟态物质 (a third copy when two are owned): the pair
|
||||
const mimic = itemTarget(m, ps, giveItem(m, ps, 'chess_item_5_05_e_a'));
|
||||
assert.ok(mimic && [pairA.uid, pairB.uid].includes(mimic.uid), '拟态物质 on the pair');
|
||||
// …but not once the pool has no third copy: the item would give nothing (GitHub #207)
|
||||
m.pool.take(pairId, m.pool.left(pairId));
|
||||
const mimic2 = itemTarget(m, ps, giveItem(m, ps, 'chess_item_5_05_e_a'));
|
||||
assert.ok(mimic2 && ![pairA.uid, pairB.uid].includes(mimic2.uid), '拟态物质 not on a pair whose pool is out');
|
||||
m.dispose();
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user