feedback5 WK: the 集成战略 (ISW-A) module rule is a roster rule — validateDiyPicks (so room.diy, PlayerState.setDiy and the picker) refuses it, checkDiyPick / diyRecordOf / the sim still compose any module of the form (the kits' tests and the golden diy family field them); shared/diy.js diyModuleOf; docs follow
Golden unchanged.
This commit is contained in:
1 parent
cde3e7305e
commit
853566129c
3 files changed
+33
-15
No files matched your search
+22
-7
@@ -12,8 +12,10 @@
|
||||
// - no 特质 (PRTS "甄选加入的干员不会拥有任何特质"); bonds from the operator's factions (`diy.operators[id].bonds`);
|
||||
// - the normal form is E2 Lv1, skill rank 4, no module; the elite E2 Lv60, rank 7, its module at stage 1 (tier 5) or 3
|
||||
// (tier 6) — the slot record's `status` (activity_table diyChessDict) picks the unit form;
|
||||
// - an owned pick chooses its skill (any of 3) and module (any of its modules but a 集成战略-only one — ISW-A, "在集成战略
|
||||
// 中…" [ASSUMED: not usable outside 集成战略, the owner's decision of 2026-10-05] — or none); a prototype carries the skill
|
||||
// - an owned pick chooses its skill (any of 3) and module (any of its modules, or none — a roster never carries a
|
||||
// 集成战略-only one: ISW-A, "在集成战略中…" [ASSUMED: not usable outside 集成战略, the owner's decision of 2026-10-05],
|
||||
// validateDiyPicks / isDiyModule; the composed record and the sim still field any module, as the kits test them); a
|
||||
// prototype carries the skill
|
||||
// and module of its 补位 rows at that tier (`diy.locked`: "技能携带规则与系统补位时一致" — [ASSUMED] that reading, the
|
||||
// owner's decision of 2026-10-05);
|
||||
// - potential 0 for everyone [ASSUMED: no account].
|
||||
@@ -26,8 +28,9 @@ import { composeUnitRecord, unitForm, statusKey } from './standIn.js';
|
||||
export const DIY_TIERS = Object.freeze([5, 6]);
|
||||
|
||||
/**
|
||||
* Module types a 自选 pick never carries: the 集成战略 modules (ISW-A — their own effect applies only "在集成战略中")
|
||||
* [ASSUMED: not usable outside 集成战略, the owner's decision of 2026-10-05].
|
||||
* Module types a player's 自选 roster never carries: the 集成战略 modules (ISW-A — their own effect applies only "在集成
|
||||
* 战略中") [ASSUMED: not usable outside 集成战略, the owner's decision of 2026-10-05]. A roster rule (validateDiyPicks,
|
||||
* the client's picker), like the kit list: checkDiyPick / diyRecordOf still compose any module of the form.
|
||||
*/
|
||||
export const DIY_EXCLUDED_MODULE_TYPE = /^ISW-/;
|
||||
|
||||
@@ -179,7 +182,6 @@ export function checkDiyPick(slotId, pick, data) {
|
||||
if (uniEquipId !== null && !mod) {
|
||||
return { error: `${charId}: no module ${uniEquipId} at stage ${slot.golden?.status?.equipLevel ?? '?'}` };
|
||||
}
|
||||
if (mod && !proto && !isDiyModule(mod)) return { error: `${charId}: ${uniEquipId} is a 集成战略 module (${mod.typeName})` };
|
||||
return { ok: true, pick: { charId, skillIndex, uniEquipId } };
|
||||
}
|
||||
|
||||
@@ -221,10 +223,21 @@ export function diyRecord(slotId, pick, { elite = false, data } = { data: null }
|
||||
return diyRecordOf(elite || slot.elite ? slot.golden : slot.normal, pick, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* The module record `uniEquipId` of `charId`'s elite form at a slot's stage (data/backups.json form `modules[]`), or null.
|
||||
* @param {string} slotId @param {string} charId @param {string} uniEquipId @param {DiyData} data
|
||||
*/
|
||||
export function diyModuleOf(slotId, charId, uniEquipId, data) {
|
||||
const slot = diySlot(slotId, data);
|
||||
const form = slot?.golden ? unitForm(backupsOf(data), charId, slot.golden.status) : null;
|
||||
return (form?.modules ?? []).find((m) => m && m.uniEquipId === uniEquipId) ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a whole 自选 roster: `picks` maps slot base ids to a pick (absent / null = an empty slot). Strict: an unknown
|
||||
* slot, an illegal pick (checkDiyPick), an operator without a kit (when `kitted` is given), the same operator twice in
|
||||
* one tier, or an owned operator in two slots rejects the roster; a prototype may fill a tier-5 and a tier-6 slot.
|
||||
* slot, an illegal pick (checkDiyPick), a 集成战略 module (isDiyModule), an operator without a kit (when `kitted` is
|
||||
* given), the same operator twice in one tier, or an owned operator in two slots rejects the roster; a prototype may fill
|
||||
* a tier-5 and a tier-6 slot.
|
||||
* @param {any} picks
|
||||
* @param {{ data: DiyData, kitted?: Kitted }} opts
|
||||
* @returns {{ ok: true, picks: Record<string, DiyLoadout> } | { error: 'BAD_MSG'|'BAD_TARGET', detail: string }}
|
||||
@@ -245,6 +258,8 @@ export function validateDiyPicks(picks, { data, kitted = null } = { data: null }
|
||||
if (!('ok' in c)) return { error: 'BAD_TARGET', detail: c.error };
|
||||
const { charId } = c.pick;
|
||||
if (!ok(charId)) return { error: 'BAD_TARGET', detail: `${charId} has no kit yet` };
|
||||
const mod = c.pick.uniEquipId ? diyModuleOf(slotId, charId, c.pick.uniEquipId, data) : null;
|
||||
if (mod && !isDiyModule(mod)) return { error: 'BAD_TARGET', detail: `${charId}: ${c.pick.uniEquipId} is a 集成战略 module (${mod.typeName})` };
|
||||
const tier = diy.slots[slotId].tier;
|
||||
const inTier = byTier.get(tier) ?? new Set();
|
||||
if (inTier.has(charId)) return { error: 'BAD_TARGET', detail: `${charId} fills two tier-${tier} slots` };
|
||||
|
||||
Reference in new issue
Block a user