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.
35 lines
1.9 KiB
JavaScript
35 lines
1.9 KiB
JavaScript
// server/sim/content/kits/ops/chess_char_1_12-estell.js — 艾丝黛尔 (char_127_estell) kit, tier 1.
|
||
// Conventions of the tier-1 kits: ../shared/tier1.js; kit contract and rules: ../README.md.
|
||
|
||
import { absoluteRangeKeys } from '../../../targeting.js';
|
||
import { bodyInKeys } from '../../../body.js';
|
||
import { num, talentBb, talentGrid, traitBb, up, cheb, onHitOn, skillBbOf } from '../shared/tier1.js';
|
||
|
||
export default {
|
||
// ---------------------------------------------------------------------------------------------------------------
|
||
// 1_12 艾丝黛尔 舍身突击 (hurt SP): ATK +atk, cannot be healed by others. 自愈能力: an enemy dying within the talent
|
||
// grid (8 surrounding tiles) heals her hp_ratio × max HP. Elite module (CEN-Y): above hp_ratio HP, physical damage
|
||
// taken −damage_resistance.
|
||
// Alternate S1 攻击力强化·β型: ATK +atk (she stays a heal target).
|
||
chess_char_1_12_a: (bb, chess) => {
|
||
const t = talentBb(chess, 0);
|
||
const grid = talentGrid(chess, 0);
|
||
const tb = traitBb(chess);
|
||
return {
|
||
skill: { kind: 'duration', mods: { atkPct: num(bb.atk) }, flags: { noHeal: true } },
|
||
skills: { 'skcom_atk_up[2]': { kind: 'duration', mods: { atkPct: num(skillBbOf(chess, 'skcom_atk_up[2]').atk) } } },
|
||
talents: [{ install(battle, unit) {
|
||
battle.on('death', (ctx) => {
|
||
const e = ctx.unit;
|
||
if (e.side !== 'enemy' || ctx.reason !== 'killed' || !up(unit)) return;
|
||
const near = grid ? bodyInKeys(e, absoluteRangeKeys(grid, unit.tileR, unit.tileC, unit.dir, 0)) : cheb(unit, e) <= 1;
|
||
if (near) battle.heal(unit, unit, unit.s.maxHp * num(t.hp_ratio), { self: true, tags: ['talent'] });
|
||
}, { owner: unit });
|
||
if (tb.damage_resistance != null) {
|
||
onHitOn(battle, unit, ({ dmg }) => { if (dmg.type === 'phys' && unit.hpRatio > num(tb.hp_ratio)) dmg.mul *= 1 - num(tb.damage_resistance); });
|
||
}
|
||
} }],
|
||
};
|
||
},
|
||
};
|