Pure move: every line of a kit, of a helper and of the tier headers is copied verbatim (only the headers' first
line names the new file); a helper used by one kit moved into that kit's file. Glue only: the generated imports,
`export default { … }` around each registry entry, `export { … }` lists in shared/tier2..6.js, and tier4's
`(bb, chess, def)` default-argument wrapper as shared/tier4.js `withDefaults` (applied in each tier-4 kit file).
kits/index.js loads every kit file with a guarded dynamic import (browser-safe, no directory listing); tierN.js
re-export the tier registry (TIER_KITS) and their old named exports (tier1 helpers + tinmanKit, tier6
PITHST_ELEMENTS). The merged registry, every tier default and named export have the same keys, order, frozenness
and function sources as before. test/docs-consistency.test.js reads the moved code at its new paths.
Golden: GOLDEN_FULL=1 node --test test/golden.test.js unchanged.
37 lines
1.7 KiB
JavaScript
37 lines
1.7 KiB
JavaScript
// server/sim/content/kits/ops/chess_char_3_03-swire.js — 诗怀雅 (char_308_swire) kit, tier 3.
|
||
// Conventions of the tier-3 kits: ../shared/tier3.js; kit contract and rules: ../README.md.
|
||
|
||
import { num, defOf, talentBb, altSkills, gridKeys, copyGrid, NINE, aura } from '../shared/tier3.js';
|
||
|
||
export default {
|
||
// ---- 3_03 诗怀雅 · 教官 — S2 协同作战: ATK +, first talent ×talent_scale; 近距离作战指导 melee ATK aura
|
||
// S1 指挥调度: the talent covers the skill's range (x-1 normal / x-2 elite) at ×talent_scale while it runs
|
||
chess_char_3_03_a: (bb, chess, def) => {
|
||
const d = defOf(chess, def);
|
||
const t0 = talentBb(d, 0);
|
||
const tGrid = copyGrid(d.talents?.[0]?.rangeGrid) ?? NINE;
|
||
const scale = num(bb.talent_scale, 1);
|
||
// "第一天赋生效范围扩大" (talent_range_flag): the selected skill's range replaces the talent's while it is active
|
||
const skillTGrid = num(bb.talent_range_flag) > 0 ? copyGrid(d.skill?.rangeGrid) : null;
|
||
const refresh = ({ unit }) => unit.mem.swireAura?.();
|
||
return {
|
||
skill: {
|
||
kind: 'duration',
|
||
mods: { atkPct: num(bb.atk) },
|
||
onStart: refresh,
|
||
onEnd: refresh,
|
||
},
|
||
skills: altSkills(chess, d, bb, {
|
||
skchr_swire_1: () => ({ kind: 'duration', onStart: refresh, onEnd: refresh }),
|
||
}),
|
||
talents: [{ install(battle, unit) {
|
||
unit.mem.swireAura = aura(battle, unit, {
|
||
key: 'talent:swire_guide', side: 'ally', tiles: () => gridKeys(skillTGrid && unit.skill?.active ? skillTGrid : tGrid, unit),
|
||
filter: (a) => String(a.def?.position ?? 'MELEE').toUpperCase() === 'MELEE',
|
||
mods: () => ({ atkPct: num(t0.atk) * (unit.skill?.active ? scale : 1) }),
|
||
});
|
||
} }],
|
||
};
|
||
},
|
||
};
|