feedback5 R4: one file per operator kit — kits/tier1..6.js split into kits/ops/<chessId>-<codename>.js (129 kits), kits/shared/tier1..6.js (the helpers two or more kits of a tier use, and each tier's header notes) and kits/index.js (the registry, same keys in the same order); the tier files become re-export shims
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.
This commit is contained in:
1 parent
6b489b1776
commit
1169102d46
143 files changed
+12924
-11784
No files matched your search
@@ -0,0 +1,55 @@
|
||||
// server/sim/content/kits/ops/chess_char_3_14-slbell.js — 初雪 (char_174_slbell) kit, tier 3.
|
||||
// Conventions of the tier-3 kits: ../shared/tier3.js; kit contract and rules: ../README.md.
|
||||
|
||||
import { num, defOf, talentBb, altSkills, aura } from '../shared/tier3.js';
|
||||
|
||||
export default {
|
||||
// ---- 3_14 初雪 · 削弱者 — S2 自然震慑: DEF/RES shred aura on every enemy in range; 虚弱化: low-HP enemies fragile;
|
||||
// 双响: 2 targets
|
||||
chess_char_3_14_a: (bb, chess, def) => {
|
||||
const d = defOf(chess, def);
|
||||
const t0 = talentBb(d, 0), t1 = talentBb(d, 1);
|
||||
const mr = num(bb.magic_resistance, 0);
|
||||
const shred = { defPct: num(bb.def) };
|
||||
if (mr) {
|
||||
if (Math.abs(mr) < 1) shred.resMul = Math.max(0, 1 + mr);
|
||||
else shred.resFlat = mr;
|
||||
}
|
||||
const mt = Math.floor(num(t1['attack@max_target'], 1));
|
||||
const kit = {
|
||||
skill: {
|
||||
kind: 'duration',
|
||||
onStart({ battle, unit }) {
|
||||
if (!unit.mem.slbellAura) unit.mem.slbellAura = aura(battle, unit, { key: 'skill:slbell_shred', side: 'enemy', interval: 0, tiles: () => unit.rangeKeySet, mods: shred });
|
||||
unit.mem.slbellAura();
|
||||
},
|
||||
onTick({ unit }) { unit.mem.slbellAura?.(); },
|
||||
onEnd({ unit }) { unit.mem.slbellAura?.clear(); },
|
||||
},
|
||||
// S1 传音回响: 2 targets, every enemy in range ASPD + attack_speed (negative) while it runs
|
||||
skills: altSkills(chess, d, bb, {
|
||||
skchr_slbell_1: (s) => {
|
||||
const slow = { aspd: num(s.bb.attack_speed) };
|
||||
return {
|
||||
kind: 'duration',
|
||||
targeting: { maxTargets: Math.max(1, Math.floor(num(s.bb['attack@max_target'], num(s.bb.max_target, 1)))) },
|
||||
onStart({ battle, unit }) {
|
||||
if (!unit.mem.slbellSlow) unit.mem.slbellSlow = aura(battle, unit, { key: 'skill:slbell_aspd', side: 'enemy', interval: 0, tiles: () => unit.rangeKeySet, mods: slow });
|
||||
unit.mem.slbellSlow();
|
||||
},
|
||||
onTick({ unit }) { unit.mem.slbellSlow?.(); },
|
||||
onEnd({ unit }) { unit.mem.slbellSlow?.clear(); },
|
||||
};
|
||||
},
|
||||
}),
|
||||
talents: [{ install(battle, unit) {
|
||||
aura(battle, unit, {
|
||||
key: 'talent:weak_fragile', side: 'enemy', tiles: () => unit.rangeKeySet, filter: (e) => e.hpRatio < num(t0.hp_ratio, 0.4),
|
||||
mods: { dmgTakenMul: num(t0.damage_scale, 1) }, interval: 0.1,
|
||||
});
|
||||
} }],
|
||||
};
|
||||
if (mt > 1) kit.trait = { maxTargets: mt };
|
||||
return kit;
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user