feedback5 WE2: effects, reward pools and 机变 cards that grant a random operator also draw the player's 自选 pieces (#9)
「自选干员放入后模拟中的补给池随机范围也将被相应扩大」: player/diy.js diyStockEntries (every slotted piece with copies left; the roll's own tier rules, no 调度中心 gate) joins effectsMeta ctx.rollChess / ctx.rollPool (spDraft rollPool extra + chessOf: bonds through the player's view) and the 驰援 fallback in choices.js. Granted from the player's own stock (poolOf). Docs: META, PLAYING. Golden: no scenario moved.
This commit is contained in:
1 parent
7a3d53faf6
commit
7b83028139
7 files changed
+124
-11
No files matched your search
@@ -152,9 +152,11 @@ export class MatchSpDraft {
|
||||
* Roll a choices.json pool (ctx.rollPool). Equip pools → rollItemId. Chess pools: an `items` (uniform) or `weighted`
|
||||
* list — only chess with a free pool copy (or outside the pool) qualify — else a copy-weighted draw from the shared
|
||||
* pool filtered by `tier` / `minTier` / `maxTier` (number or 'shopLevel') / `bond`; `golden: true` yields the elite id.
|
||||
* `extra` (the drawing player's 自选 stock, player/diy.js diyStockEntries) joins that shared-pool draw, `chessOf` reads the
|
||||
* bonds (the player's data view: a slotted slot's operator) — 0.2.0 WE2.
|
||||
* @returns {{ kind: 'item'|'chess', id: string, golden?: boolean } | null}
|
||||
*/
|
||||
rollPool(poolId, { shopLevel = 6 } = {}) {
|
||||
rollPool(poolId, { shopLevel = 6, extra = null, chessOf = null } = {}) {
|
||||
const pools = this.gd.choices.pools && typeof this.gd.choices.pools === 'object' ? this.gd.choices.pools : {};
|
||||
const p = typeof poolId === 'string' && Object.hasOwn(pools, poolId) ? pools[poolId] : null;
|
||||
if (!p || typeof p !== 'object') return null;
|
||||
@@ -181,10 +183,12 @@ export class MatchSpDraft {
|
||||
const maxTier = p.maxTier === 'shopLevel' ? lvl : Number.isInteger(p.maxTier) ? p.maxTier : 6;
|
||||
const minTier = Number.isInteger(p.minTier) ? p.minTier : 1;
|
||||
const bond = typeof p.bond === 'string' ? p.bond : null;
|
||||
const recOf = typeof chessOf === 'function' ? chessOf : (cid) => this.gd.chess(cid);
|
||||
id = this.pool.roll(rng, {
|
||||
tier: Number.isInteger(p.tier) ? p.tier : null,
|
||||
maxTier,
|
||||
filter: (cid, e) => e.tier >= minTier && (!bond || (Array.isArray(this.gd.chess(cid)?.bonds) && this.gd.chess(cid).bonds.includes(bond))),
|
||||
filter: (cid, e) => e.tier >= minTier && (!bond || (Array.isArray(recOf(cid)?.bonds) && recOf(cid).bonds.includes(bond))),
|
||||
extra,
|
||||
});
|
||||
}
|
||||
if (!id) return null;
|
||||
|
||||
Reference in new issue
Block a user