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.1 KiB
JavaScript
38 lines
2.1 KiB
JavaScript
// server/sim/content/kits/ops/chess_char_2_18-ashlok.js — 灰毫 (char_431_ashlok) kit, tier 2.
|
||
// Conventions of the tier-2 kits: ../shared/tier2.js; kit contract and rules: ../README.md.
|
||
|
||
import { num, talentBb, traitBb, onHitBy, batMod } from '../shared/tier1.js';
|
||
|
||
export default {
|
||
// ---------------------------------------------------------------------------------------------------------------
|
||
// 2_18 灰毫 攻击力强化·γ型 (DEFAULT, like S2: the owner's deliberate deviation from the 重装 TAKE_DAMAGE row, data
|
||
// TRIGGER_DEVIATIONS, DESIGN §21.29): ATK +atk. 炮术研习: ATK +atk, or +ashlok_t_1.atk when the `cnt` orthogonal
|
||
// tiles around her are all ground (LOW). Elite module (FOR-X, trait atk_scale): vs blocked enemies ATK ×atk_scale.
|
||
// S2 专注轰击 (alt): block count 0 (noBlock: releases what she holds), only ranged (splash) attacks, base attack time
|
||
// +base_attack_time s (−0.4 / −0.5 on 2.8), ATK +atk.
|
||
chess_char_2_18_a: (bb, chess) => {
|
||
const t = talentBb(chess, 0);
|
||
const tb = traitBb(chess);
|
||
return {
|
||
skill: { kind: 'duration', mods: { atkPct: num(bb.atk) } },
|
||
skills: {
|
||
skchr_ashlok_2: {
|
||
kind: 'duration', mods: { atkPct: num(bb.atk), batPct: batMod(bb.base_attack_time, chess) }, flags: { noBlock: true },
|
||
attack: { fortress: false, _fortressMelee: false },
|
||
},
|
||
},
|
||
talents: [{ install(battle, unit) {
|
||
battle.on('deploy', ({ unit: u }) => {
|
||
if (u !== unit) return;
|
||
const r = unit.tileR, c = unit.tileC;
|
||
const low = [[1, 0], [-1, 0], [0, 1], [0, -1]].filter(([dr, dc]) => battle.grid.isLow(r + dr, c + dc)).length;
|
||
const ground = low >= num(t.cnt, 4);
|
||
const v = ground ? num(t['ashlok_t_1.atk'], num(t.atk)) : num(t.atk);
|
||
if (v) battle.addBuff(unit, { key: 'talent:ashlok', mods: { atkPct: v }, data: { ground }, tags: ['talent'] });
|
||
}, { owner: unit });
|
||
if (num(tb.atk_scale, 1) !== 1) onHitBy(battle, unit, ({ target, dmg }) => { if (dmg.isAttack && target.blockedBy) dmg.amount *= num(tb.atk_scale, 1); });
|
||
} }],
|
||
};
|
||
},
|
||
};
|