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.
80 lines
4.4 KiB
JavaScript
80 lines
4.4 KiB
JavaScript
// server/sim/content/kits/ops/chess_char_3_08-mint.js — 薄绿 (char_388_mint) kit, tier 3.
|
||
// Conventions of the tier-3 kits: ../shared/tier3.js; kit contract and rules: ../README.md.
|
||
|
||
import { num, defOf, talentBb, traitBb, altSkills, gridKeys, fx, copyGrid, enemiesOn, aura } from '../shared/tier3.js';
|
||
|
||
export default {
|
||
// ---- 3_08 薄绿 · 阵法术师 — S2 聚能涡旋: each attack strikes every enemy on her range (the trait's 群体法术伤害) and
|
||
// pushes each one towards her, end-of-skill burst on
|
||
// every enemy in range; 地质学者: DEF aura (skill off) / less likely targeted (skill on);
|
||
// 精锐 module PLX-X: keeps part of the guard (DEF/RES) while the skill runs
|
||
// S1 风语: wider range (skill grid), attacks every enemy on it at attack@atk_scale. Auto-cast: the data
|
||
// rule SEARCH is the 阵法术师 row (PRTS 卫戍协议/帮助 "不受基础策略影响,在初始攻击范围内存在敌人时释放技能"; it
|
||
// covers every MANUAL skill of the class — user playtest #6) = an enemy inside her INITIAL range — the engine's
|
||
// DEFAULT rule, checked every tick for a unit that does not attack while its skill is off — not any enemy on the
|
||
// field: she would burn the skill on enemies that just spawned.
|
||
chess_char_3_08_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) ?? [[1, 0], [0, -1], [0, 0], [0, 1], [-1, 0]];
|
||
const pullForce = num(bb['attack@force'], num(bb.force, 0));
|
||
const endScale = num(bb.atk_scale, 0);
|
||
const keepDef = num(tb['soil_e_002[buff].def'], 0), keepRes = num(tb['soil_e_002[buff].magic_resistance'], 0);
|
||
// every skill: PLX-X keeps part of the guard, 地质学者 taunt −1 while it runs, DEF aura only while it does not
|
||
const guardOn = ({ battle, unit }) => {
|
||
if (keepDef || keepRes) battle.addBuff(unit, { key: 'trait:mint_keep', mods: { defPct: keepDef, resFlat: keepRes } });
|
||
battle.addBuff(unit, { key: 'talent:mint_taunt', mods: { taunt: num(t0.taunt_level, -1) } });
|
||
unit.mem.mintAura?.();
|
||
};
|
||
const guardOff = ({ battle, unit }) => {
|
||
battle.removeBuff(unit, 'trait:mint_keep');
|
||
battle.removeBuff(unit, 'talent:mint_taunt');
|
||
unit.mem.mintAura?.();
|
||
};
|
||
return {
|
||
skills: altSkills(chess, d, bb, {
|
||
skchr_mint_1: (s) => {
|
||
const grid = copyGrid(s.rangeGrid);
|
||
return {
|
||
kind: 'duration',
|
||
trigger: { rule: 'DEFAULT' },
|
||
attack: { atkScale: num(s.bb['attack@atk_scale'], num(s.bb.atk_scale, 1)) },
|
||
...(grid ? { targeting: { rangeGrid: grid } } : {}),
|
||
onStart: guardOn,
|
||
onEnd: guardOff,
|
||
};
|
||
},
|
||
}),
|
||
skill: {
|
||
kind: 'duration',
|
||
attack: {
|
||
atkScale: num(bb['attack@atk_scale'], 1),
|
||
onHit({ battle, unit, target }) {
|
||
if (!target || !target.alive || target.side !== 'enemy') return;
|
||
// PRTS 备注: "此技能的“拖拽”机制实际为反方向(指向薄绿方向)的推开" — a radial push towards her by the
|
||
// official 力度 − 重量 push distance (小力 vs weight 1: 0.44 tiles), never past her (Battle.push inward). Her
|
||
// attack reaches air units (阵法术师 "攻击时可对空"), but the drones of the mode are 静态刚体 (PRTS 特殊机制): hit,
|
||
// never dragged (player report after 0.1.0, "飞机可以被薄绿的技能拉走")
|
||
if (battle.push(target, pullForce, { from: unit, inward: true }) > 0) fx(battle, 'pull', target, { src: unit.id });
|
||
},
|
||
},
|
||
onStart: guardOn,
|
||
onEnd(ctx) {
|
||
const { battle, unit, reason } = ctx;
|
||
if (reason !== 'death' && unit.alive && endScale > 0) {
|
||
for (const e of enemiesOn(battle, unit, unit.rangeKeys)) battle.dealDamage(unit, e, { amount: unit.s.atk * endScale, type: 'arts', isSkill: true, tags: ['skill', 'burst'] });
|
||
fx(battle, 'aoe', unit, { radius: 2, dmgType: 'arts', skill: 'mint_2' });
|
||
}
|
||
guardOff(ctx);
|
||
},
|
||
},
|
||
talents: [{ install(battle, unit) {
|
||
unit.mem.mintAura = aura(battle, unit, {
|
||
key: 'talent:mint_geo', side: 'ally', tiles: () => gridKeys(tGrid, unit), active: () => !unit.skill?.active, mods: { defPct: num(t0.def) },
|
||
});
|
||
} }],
|
||
};
|
||
},
|
||
};
|