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.
38 lines
2.0 KiB
JavaScript
38 lines
2.0 KiB
JavaScript
// server/sim/content/kits/ops/chess_char_4_14-lionhd.js — 莱恩哈特 (char_373_lionhd) kit, tier 4.
|
||
// Conventions of the tier-4 kits: ../shared/tier4.js; kit contract and rules: ../README.md.
|
||
|
||
import {
|
||
num, tbb, grid, targetsInRange, whileDeployed, toggleBuff, resCut, alt, applyModuleRange, withDefaults,
|
||
} from '../shared/tier4.js';
|
||
|
||
export default withDefaults({
|
||
// ===== 莱恩哈特 (splashcaster) S2 解构与爆破 — charges: 170 % arts to all in the wider range + RES −8 % for 6 s; 破片杀伤
|
||
chess_char_4_14_a: (bb, chess, def) => {
|
||
const t0 = tbb(def, 0);
|
||
const g = grid(def.skill?.rangeGrid);
|
||
const mr = num(bb.magic_resistance, 0);
|
||
return {
|
||
skills: alt(def, { 'skcom_atk_up[3]': () => ({ kind: 'duration', mods: { atkPct: num(bb.atk) } }) }), // S1 攻击力强化·γ型
|
||
skill: {
|
||
kind: (def.skill?.maxCharges ?? 1) > 1 ? 'charges' : 'instant',
|
||
targeting: g ? { rangeGrid: g } : undefined,
|
||
onStart({ battle, unit }) {
|
||
for (const e of targetsInRange(battle, unit)) {
|
||
battle.dealDamage(unit, e, { amount: unit.s.atk * num(bb.atk_scale, 1.7), type: 'arts', isSkill: true, tags: ['skill', 'burst'] });
|
||
// 同名效果取最高: one RES cut per enemy (the strongest), never one per 莱恩哈特
|
||
if (e.alive && mr) battle.applyStrongest(e, 'lionhd:res', { duration: num(bb.duration, 6), value: mr, mods: resCut, source: unit });
|
||
}
|
||
battle.fx('explosion', { x: unit.x, y: unit.y, id: unit.id });
|
||
},
|
||
},
|
||
talents: [{ install(battle, unit) { // 破片杀伤: ATK +4 % per enemy in range (≤ 5)
|
||
whileDeployed(battle, unit, 0.1, () => {
|
||
const n = Math.min(num(t0.max_valid_stack_cnt, 5), targetsInRange(battle, unit).length);
|
||
toggleBuff(battle, unit, 'lionhd:t1', n > 0, { atkPct: num(t0.atk, 0.04) * n });
|
||
});
|
||
} }],
|
||
install(battle, unit) { applyModuleRange(battle, unit, def); }, // module SPC-X (elite default): 攻击范围扩大
|
||
};
|
||
},
|
||
});
|