diff --git a/server/sim/content/kits/tier5.js b/server/sim/content/kits/tier5.js index f2beb571..9116b5a0 100644 --- a/server/sim/content/kits/tier5.js +++ b/server/sim/content/kits/tier5.js @@ -1985,6 +1985,10 @@ const KITS = { skills: lazySkills({ skchr_thorn2_1: () => ({ kind: instantKind(chess, def), + // an AUTO skill (skill_table 自动触发) that throws at an ally: it fires as soon as its SP is full, with or + // without an enemy — the basic DEFAULT rule waited for an attack, so with no enemy around it sat at 7/7 + // (GitHub #124 「引星棘刺一技能不会在满技力时自动释放」) + trigger: { rule: 'SP_FULL' }, onStart({ battle, unit }) { const t = battle.alliesInGrid(unit).filter((a) => a.hp > 0).sort((a, b) => a.hpRatio - b.hpRatio || b.blocking.length - a.blocking.length || dist(a, unit) - dist(b, unit) || a.id - b.id)[0]; if (!t) return; diff --git a/test/content/kits_alt_t5.test.js b/test/content/kits_alt_t5.test.js index 58221883..12d0b54e 100644 --- a/test/content/kits_alt_t5.test.js +++ b/test/content/kits_alt_t5.test.js @@ -1028,6 +1028,23 @@ test('引星棘刺 S1 度算浪波: an alchemy unit on the lowest-HP ally: DEF + } }); +test('引星棘刺 S1 度算浪波 (AUTO): fires as soon as its SP is full, no enemy needed (GitHub #124)', () => { + for (const id of pair('15')) { + const h = run({ + defs: { chess: { t_low: ally('t_low') } }, + units: [entry(id, 'skchr_thorn2_1', { row: 10, col: 3 }), { chessId: 't_low', row: 10, col: 5 }], + enemies: [], + }); + const u = sel(h, id, 'skchr_thorn2_1'); + h.step(); + assert.equal(h.b.enemies.length, 0, 'no enemy on the field'); + const need = u.skill.spCost - u.skill.sp; + h.run(need + 0.5); + assert.ok((u.mem.zones || []).some((z) => z.type === 'guard'), `cast within ${need.toFixed(1)} s of SP filling, no enemy around`); + done(h); + } +}); + test('引星棘刺 S3 “我的海疆”: passive skill range; alchemy units on the 3 lowest-block ops debuff (不叠加) and burn enemies around them, ramping to the max after 15 s', () => { for (const id of pair('15')) { const h = run({