feedback5 CB5: a module's added trait line (official additionalDescription, PRTS 特性追加) shows after the class trait, not instead of it — the 干员调配 module card (特性 + 特性追加 rows), its 局内数值, the detail card and the 自选 module row (community report of 2026-10-06, item 16.2: 114 of the 164 modules the screen offers showed the extra line alone)
Text only: data/chess.json keeps both lines (traitOverride.desc = the class trait or the module's rewrite, moduleDesc = the added line) and the battle unit keeps the class trait with the module on — the same trait text, targeting and attack shape as 不装备 for every added-line module (圣约送葬人 REA-Y also rewrites it). New helpers ui/loadoutModel.js traitLines / fullTraitText; traitText (ui/detailPanel.js) composes the two. Golden unchanged (no sim change). Tests: test/ui/feedback5-module-trait.test.js (new), loadout-stats updated.
This commit is contained in:
1 parent
30d9a41c51
commit
02353e13f8
8 files changed
+196
-20
No files matched your search
@@ -325,6 +325,29 @@ export function moduleBadge(rec, id = null) {
|
||||
return m ? m[1] : t.slice(-1) || '?';
|
||||
}
|
||||
|
||||
/**
|
||||
* The two lines of a trait record (data `trait` / `traitBase`, ModuleRecord `traitOverride`, DATA.md §2): `base` = the
|
||||
* 特性 the unit fights with — the class trait, or the module's own wording where the module rewrites it (official
|
||||
* `overrideDescripton`) — and `added` = the module's extra line (official `additionalDescription`), or null. The extra
|
||||
* line comes after the class trait, never instead of it: PRTS flags it 「特性追加」 on every such module, and the sim keeps
|
||||
* the class trait with the module equipped (community report of 2026-10-06, item 16.2: until 0.2.0 the 干员调配 module
|
||||
* card, its 局内数值 and the detail card showed the extra line alone on 114 of the 164 modules the screen offers).
|
||||
* @param {any} trait
|
||||
* @returns {{ base: string, added: string|null }}
|
||||
*/
|
||||
export function traitLines(trait) {
|
||||
if (!isObj(trait)) return { base: '', added: null };
|
||||
const base = String(trait.descRaw || trait.desc || '');
|
||||
const added = trait.moduleDescRaw || trait.moduleDesc || null;
|
||||
return { base, added: added ? String(added) : null };
|
||||
}
|
||||
|
||||
/** The whole 特性 text of a trait record: its base line, then the module's extra line (`\n` between; RichText breaks it). */
|
||||
export function fullTraitText(trait) {
|
||||
const { base, added } = traitLines(trait);
|
||||
return base && added ? `${base}\n${added}` : base || added || '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Module stat bonus as display rows (non-zero entries only).
|
||||
* @param {Record<string, number> | null | undefined} attr
|
||||
|
||||
Reference in new issue
Block a user