Files
ark-stronghold-protocol/server/sim/content/kits/ops/chess_char_3_02-ayer.js
T
sganggs 1169102d46 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.
2026-10-05 16:13:56 +08:00

68 lines
3.1 KiB
JavaScript

// server/sim/content/kits/ops/chess_char_3_02-ayer.js — 断崖 (char_294_ayer) kit, tier 3.
// Conventions of the tier-3 kits: ../shared/tier3.js; kit contract and rules: ../README.md.
import {
num, defOf, talentBb, traitBb, altSkills, instantKindOf, alive, gridKeys, fx, copyGrid, NINE, aura,
} from '../shared/tier3.js';
export default {
// ---- 3_02 断崖 · 领主 — S2 浮游刃启动: arts, wider range, each attack hits every enemy blocked by allies around her
chess_char_3_02_a: (bb, chess, def) => {
const d = defOf(chess, def);
const t0 = talentBb(d, 0);
const tb = traitBb(d);
const tGrid = copyGrid(d.talents?.[0]?.rangeGrid) ?? NINE;
const extra = num(bb.atk_scale, 1);
const moduleArts = num(tb.atk_scale_m, 0);
const skillGrid = copyGrid(d.skill?.rangeGrid);
const kit = {
skill: {
kind: 'duration',
attack: { dmgType: 'arts', atkScale: num(bb['attack@atk_scale'], 1) },
onAttack({ battle, unit }) {
// "周围8格友方单位阻挡的所有敌人": the 8 tiles around her (her own tile is not one of them — the talent
// says "自身与周围8格" when it means both)
const seen = new Set();
for (const a of battle.allyUnits) {
if (a === unit || !alive(a) || a.kind === 'device' || !a.blocking.length) continue;
if (Math.abs(a.tileR - unit.tileR) > 1 || Math.abs(a.tileC - unit.tileC) > 1) continue;
for (const e of a.blocking) {
if (!e.alive || seen.has(e)) continue;
seen.add(e);
battle.dealDamage(unit, e, { amount: unit.s.atk * extra, type: 'arts', isSkill: true, tags: ['skill', 'melee', 'ayerBlade'] });
fx(battle, 'strike', e, { src: unit.id, skill: 'ayer_2' });
}
}
},
},
// S1 多导向散射弹丸: next attack hits up to max_target enemies in range for atk_scale arts + 停顿
skills: altSkills(chess, d, bb, {
skchr_ayer_1: (s) => {
const slug = num(s.bb.sluggish, 0);
return {
kind: instantKindOf(s),
targeting: { maxTargets: Math.max(1, Math.floor(num(s.bb.max_target, 1))) },
attack: {
dmgType: 'arts', atkScale: num(s.bb.atk_scale, 1),
onEachHit({ battle, unit, target }) {
if (slug > 0 && target && target.alive && target.side === 'enemy') battle.applyStatus(target, 'sluggish', { duration: slug, source: unit });
},
},
};
},
}),
talents: [{ install(battle, unit) {
aura(battle, unit, { key: 'talent:ayer_aspd', side: 'ally', tiles: () => gridKeys(tGrid, unit), filter: (a) => a.kind === 'op', mods: { aspd: num(t0.attack_speed) } });
} }],
};
if (skillGrid) kit.skill.targeting = { rangeGrid: skillGrid };
// 精锐 module LOR-X: "攻击附带10%攻击力的法术伤害"
if (moduleArts > 0) {
kit.trait = { afterHit: (battle, unit, target) => {
if (target && target.alive) battle.dealDamage(unit, target, { amount: unit.s.atk * moduleArts, type: 'arts', tags: ['module'] });
} };
}
return kit;
},
};