Files
ark-stronghold-protocol/server/sim/content/kits/ops/chess_char_5_23-reckpr.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

51 lines
2.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// server/sim/content/kits/ops/chess_char_5_23-reckpr.js — 录武官 (char_4196_reckpr) kit, tier 5.
// Conventions of the tier-5 kits: ../shared/tier5.js; kit contract and rules: ../README.md.
import { isHpLoss } from '../../../damage.js';
import {
num, on, inRange, talent, traitBb, mods, isOp, lazySkills, instantKind, lowHpHealUp,
} from '../shared/tier5.js';
export default {
// ---------------------------------------------------------------------------------------------------------------
// 录武官 — S2 一点关窍 (25 s): ATK +; healed allies get a 10 s buff healing 80/120 HP on every hit taken.
// T1 学成于聚: an op in range starting a skill → +1 SP and ASPD +16 for 8 s. Module (elite): heals below 50 % ×1.15.
// S1 触类旁通 (2/3 charges): the next heal restores heal_scale × ATK and heals max_target allies.
chess_char_5_23_a: (bb, chess, def) => {
const t0 = talent(chess, 0), tb = traitBb(chess);
const dur = num(bb['attack@buff_duration'], 10), value = num(bb['attack@fixed_heal_value']);
return {
skills: lazySkills({
skchr_reckpr_1: () => ({ kind: instantKind(chess, def), heal: true, attack: { healScale: num(bb.heal_scale, 1), maxTargets: Math.max(1, num(bb.max_target, 2)) } }),
}),
skill: {
kind: 'duration', heal: true,
mods: mods({ atkPct: num(bb.atk) }),
onHit({ battle, unit, target }) {
// "治疗干员后为其施加一个增益": operators only (summons are 友方单位, not 干员)
if (!target || !target.alive || !isOp(target) || !(value > 0)) return;
battle.addBuff(target, { key: 'reckpr:guard', duration: dur, visible: true, data: { src: unit, value } });
},
},
talents: [{ install(battle, unit) { // 学成于聚
battle.on('skillStart', (c) => {
const a = c.unit;
if (a === unit || !isOp(a) || !on(unit) || !inRange(unit, a)) return;
if (num(t0.prob, 1) < 1 && !battle.rng.chance(num(t0.prob, 1))) return;
unit.skill?.gainSp(num(t0.sp), 'talent');
if (num(t0.attack_speed)) battle.addBuff(unit, { key: 'reckpr:learn', duration: num(t0.duration, 8), mods: { aspd: num(t0.attack_speed) } });
}, { owner: unit });
} }],
install(battle, unit) {
battle.on('damaged', (c) => {
const a = c.target;
if (a.side !== 'ally' || !(c.amount > 0) || a.hp <= 0 || c.type === 'element' || isHpLoss(c.dmg)) return; // (not a 流失)
const b = a.findBuff('reckpr:guard');
if (b && b.data.src === unit) battle.heal(unit, a, num(b.data.value));
}, { owner: unit });
lowHpHealUp(battle, unit, tb);
},
};
},
};