feedback5 WE2: remove the kits/tier1-6.js re-export shims and shared/standIn.js diyRecord (#5)
Nothing but tests imported them: kits_t3 / kits_alt_t3 / kits_t4 / kits_t5 read kits/index.js TIER_KITS, playtest5_elements / playtest6-combat / facing the real modules, simServe checks /sim/content/kits/index.js; test/backups.test.js composes the prototypes through shared/diy.js diyRecordOf at their locked selection. check:imports passes. Docs: kits/README.md, DATA.md. Golden: no scenario moved.
This commit is contained in:
1 parent
19691d0b06
commit
92a179e71e
18 files changed
+33
-81
No files matched your search
+2
-19
@@ -1,5 +1,6 @@
|
||||
// shared/standIn.js — a chess fielded with another character's body: the 补位 stand-in (原型干员) of a NORMAL chess
|
||||
// whose operator the player does not own, and a 自选 (DIY) slot filled with a prototype. Pure ESM shared by the build
|
||||
// whose operator the player does not own, and the composition a 自选 (DIY) slot uses (shared/diy.js diyRecordOf calls
|
||||
// composeUnitRecord with the pick). Pure ESM shared by the build
|
||||
// (tools/build-data.mjs proves composeUnitRecord rebuilds every PRESET chess from its own unit form), the simulation and
|
||||
// the client. Data: data/backups.json (docs/DATA.md §18).
|
||||
//
|
||||
@@ -130,21 +131,3 @@ export function standInRecord(chess, backups) {
|
||||
return composeUnitRecord(chess, unit, unitForm(backups, b.charId, chess.status),
|
||||
{ skillIndex: b.skillIndex, moduleId: b.uniEquipId ?? null, standInFor: chess.charId });
|
||||
}
|
||||
|
||||
/**
|
||||
* A 自选 slot (DIY chess record, normal or elite) filled with a prototype `charId` (backups.diy.prototypes[tier]):
|
||||
* the slot's identity (tier, price, no 特质) with the pick's derived bonds (backups.diy.operators[charId].bonds). The
|
||||
* skill and module are the caller's — which skill a prototype carries in a slot is not in the data (DESIGN 0.2.0
|
||||
* draft, open question). Null when the pick is not a legal prototype of the slot's tier or the data lacks it.
|
||||
* @param {object} slot a DIY chess record (data/chess.json, `isDiy`)
|
||||
* @param {string} charId the picked prototype
|
||||
* @param {object} backups data/backups.json
|
||||
* @param {{ skillIndex?: number, moduleId?: string|null }} [opts]
|
||||
* @returns {object|null}
|
||||
*/
|
||||
export function diyRecord(slot, charId, backups, { skillIndex, moduleId = null } = {}) {
|
||||
if (!slot?.isDiy || !(backups?.diy?.prototypes?.[slot.tier] || []).includes(charId)) return null;
|
||||
const unit = backups.units?.[charId] ?? null;
|
||||
return composeUnitRecord(slot, unit, unitForm(backups, charId, slot.status),
|
||||
{ skillIndex, moduleId, bonds: backups.diy.operators?.[charId]?.bonds ?? null });
|
||||
}
|
||||
Reference in new issue
Block a user