The report's 退行的潮涌者 is the 巢涌者 (深溟 / 富营养的巢涌者 in this mode): no normal attack, its talent hurts every operator in range once a second. Official (ArknightsGameData buff_template_data): its pulse is an AdvancedApplyDamage with the enemy as source (enemy_dsubrl_aoe[aura]); the counters fire on ON_TAKE_DAMAGE — philae_s_2 with no filter, inverse_damage (星熊 S2), inverse_damage[magic] + nian_s_2 (年 S2), bubble_s_2 / bubble_t_1 (泡泡), vendla_s_2 (刺玫), yu_s_1[inverse_damage] (余 S1), hsgma2_s_1 / hsgma2_e_003_tr_take (斩业星熊), mlynar_t_2[inverse] (玛恩纳) on a source of the other side; 棘刺 S2 (普通伤害 filter) and 信仰搅拌机 S3 already took any damage. Cause: the kits required dmg.isAttack. Now kits/shared/tier1.js byEnemyAttack = any enemy damage instance but a 流失, an element 损伤, 无来源 damage or another counter / reflection (tags 'counter' / 'reflect'); 菲莱 S2 any instance but a 流失 or a counter. test/content/op_nian.test.js pinned "a non-attack hit returns nothing" for 年 S2 — updated on purpose (answered now; a 流失 still is not). Golden: 19 scenarios where an enemy's non-attack damage (skills, pulses, areas) reached one of these operators — their counter now answers it (more damage, fx thorns / aoe): roster-002, -005, -008, -010, -012, -016, -033, -044; bond-lateranoShip-low; fields boss-boss_2-solo, boss-boss_4-pair, boss-boss_4-solo, hidden-boss_8-pair, hidden-boss_8-solo; matches solo-FUNNY-1, solo-FUNNY-2, coop4-ABYSS-7, coop2-ABYSS-10-boosted; diy-051. Tests: test/sim/feedback5-counters-any-damage.test.js (6; 5 fail on the parent, the first checks the 巢涌者 never attacks). Docs: docs/SIM.md (re-entrancy rule).
109 lines
6.5 KiB
JavaScript
109 lines
6.5 KiB
JavaScript
// server/sim/content/kits/ops/chess_char_3_06-philae.js — 菲莱 (char_4148_philae) kit, tier 3.
|
||
// Conventions of the tier-3 kits: ../shared/tier3.js; kit contract and rules: ../README.md.
|
||
|
||
import { num, defOf, talentBb, traitBb, selectedId, altSkills, fx, NINE, giveSp } from '../shared/tier3.js';
|
||
import { isHpLoss } from '../../../damage.js';
|
||
|
||
export default {
|
||
// ---- 3_06 菲莱 · 本源铁卫 — S2 冥河诅咒: stops attacking, HP +; "受到攻击时" — any damage instance she takes (official
|
||
// philae_s_2: ON_TAKE_DAMAGE with no source or attack filter) — blasts the ground enemies of the 3×3 around her
|
||
// (PRTS 备注: range x-4; arts + ep_damage_ratio × ATK apoptosis, aoe_cd); ATK + once hit by element
|
||
// damage; 神河谕使: 元素损伤 taken −damage_resistance, +SP on apoptosis
|
||
// 精锐 module PRP-X "阻挡敌人时,自身造成的元素损伤提升15%": EVERY element fill she deals (the S2 blast, a 灼燃维式重锤
|
||
// she carries …) ×ep_damage_scale while she blocks — an `elementHit` multiplier, like 余's
|
||
// S1 灵河护佑 (TAKE_DAMAGE): HP +, clears her element gauges and gives a shield_value 损伤屏障 (absorbs element
|
||
// damage — gauge fills — until spent or the skill ends)
|
||
// 神河谕使 and the barrier act on the element hit before it lands (PRTS 备注: "减伤与技力回复效果于伤害计算前处理;即使
|
||
// 受到0点的凋亡损伤依然可以回复技力", "损伤屏障于伤害计算前、第一天赋后处理"): the talent's cut and SP first (priority 20),
|
||
// then the barrier absorbs what is left (`dmg.amount × dmg.mul`). The cut is a 元素损伤 multiplier (PRTS 元素 "受到的
|
||
// 元素损伤 = 损伤值 × (1 − 损伤抵抗 × 0.01),后续可应用元素损伤倍率提升/降低等效果"), not `elemTakenMul` (元素伤害 / 元素脆弱).
|
||
chess_char_3_06_a: (bb, chess, def) => {
|
||
const d = defOf(chess, def);
|
||
const t0 = talentBb(d, 0);
|
||
const tb = traitBb(d);
|
||
const sel = selectedId(chess, d);
|
||
const S1 = 'skchr_philae_1', S2 = 'skchr_philae_2';
|
||
const isS2 = sel === S2 || sel == null;
|
||
const scale = num(bb.atk_scale, 1);
|
||
const ep = num(bb.ep_damage_ratio, 0);
|
||
const cd = num(bb.aoe_cd, 2);
|
||
const epScale = num(tb.ep_damage_scale, 1);
|
||
const cut = Math.max(0, Math.min(1, num(t0.damage_resistance)));
|
||
// 损伤屏障 of S1: absorbs the gauge gain an element hit would add (after 神河谕使)
|
||
const installBarrier = (battle, unit) => {
|
||
battle.on('elementHit', (ctx) => {
|
||
if (ctx.target !== unit || !(unit.mem.philaeBarrier > 0) || !unit.skill?.active) return;
|
||
const dmg = ctx.dmg;
|
||
const eff = num(dmg.amount) * num(dmg.mul, 1);
|
||
if (!(eff > 0)) return;
|
||
const take = Math.min(unit.mem.philaeBarrier, eff);
|
||
unit.mem.philaeBarrier -= take;
|
||
if (take >= eff - 1e-9) dmg.cancel = true;
|
||
else dmg.amount *= (eff - take) / eff;
|
||
if (!(unit.mem.philaeBarrier > 0)) fx(battle, 'shieldBreak', unit, { element: true });
|
||
}, { owner: unit });
|
||
};
|
||
return {
|
||
skill: {
|
||
kind: 'duration',
|
||
mods: { hpPct: num(bb.max_hp) },
|
||
attack: { noAttack: true },
|
||
onStart({ unit }) { unit.mem.philaeCd = -Infinity; },
|
||
onEnd({ battle, unit }) { battle.removeBuff(unit, 'skill:philae_rage'); },
|
||
},
|
||
skills: altSkills(chess, d, bb, {
|
||
[S1]: (s) => ({
|
||
kind: 'duration',
|
||
mods: { hpPct: num(s.bb.max_hp) },
|
||
onStart({ battle, unit }) {
|
||
battle.reduceElement(unit, 1e12); // "立刻清除自身的元素损伤" (a gauge locked by a running burst stays)
|
||
unit.mem.philaeBarrier = num(s.bb.shield_value, 0);
|
||
fx(battle, 'shield', unit, { element: true, n: unit.mem.philaeBarrier });
|
||
},
|
||
onEnd({ unit }) { unit.mem.philaeBarrier = 0; },
|
||
}),
|
||
}),
|
||
talents: [{ install(battle, unit) {
|
||
// 神河谕使 (every skill): 元素损伤 taken ×(1 − damage_resistance); "受到凋亡损伤时回复2点技力" — even for 0 damage
|
||
battle.on('elementHit', (ctx) => {
|
||
const dmg = ctx.dmg;
|
||
if (ctx.target !== unit || !dmg || dmg.type !== 'element') return;
|
||
if (dmg.element === 'apoptosis' && !unit.skill?.active) giveSp(unit, num(t0.sp), 'talent');
|
||
if (cut > 0) dmg.mul *= 1 - cut;
|
||
}, { owner: unit, priority: 20 });
|
||
} }],
|
||
install(battle, unit) {
|
||
if (sel === S1) installBarrier(battle, unit);
|
||
// module PRP-X: her element damage ×ep_damage_scale while she blocks
|
||
if (epScale > 1) {
|
||
battle.on('elementHit', (ctx) => {
|
||
if (ctx.source === unit && ctx.dmg?.type === 'element' && ctx.target?.side === 'enemy' && unit.blocking.length) ctx.dmg.mul *= epScale;
|
||
}, { owner: unit });
|
||
}
|
||
battle.on('damaged', (ctx) => {
|
||
if (ctx.target !== unit || !unit.alive) return;
|
||
const sk = unit.skill;
|
||
if (ctx.type === 'element') {
|
||
if (isS2 && sk && sk.active && !unit.findBuff('skill:philae_rage')) battle.addBuff(unit, { key: 'skill:philae_rage', mods: { atkPct: num(bb.atk) }, visible: true });
|
||
return;
|
||
}
|
||
// the official philae_s_2 (buff_template_data) fires on ON_TAKE_DAMAGE with no filter: any damage instance — an
|
||
// enemy's attack, a skill hit, 深溟巢涌者's pulse, a 无来源 hit — never a 流失 or an element 损伤 (above), nor a
|
||
// counter / reflection. Until 0.2.0 enemy attacks only (community report of 2026-10-06, item 30)
|
||
const d = ctx.dmg;
|
||
if (!isS2 || !sk || !sk.active || !d || isHpLoss(d) || (d.tags || []).some((t) => t === 'counter' || t === 'reflect')) return;
|
||
if (battle.time < (unit.mem.philaeCd ?? -Infinity)) return;
|
||
unit.mem.philaeCd = battle.time + cd;
|
||
// "周围的地面敌人" = range x-4, the 3×3 tiles around her (PRTS 备注)
|
||
for (const e of battle.unitsInGrid(unit, NINE, { side: 'enemy' })) {
|
||
if (e.isFlying) continue;
|
||
battle.dealDamage(unit, e, { amount: unit.s.atk * scale, type: 'arts', canDodge: false, isSkill: true, tags: ['skill', 'counter'] });
|
||
if (ep > 0 && e.alive) battle.dealDamage(unit, e, { type: 'element', element: 'apoptosis', amount: unit.s.atk * ep, tags: ['skill'] });
|
||
}
|
||
fx(battle, 'aoe', unit, { radius: 1.5, tiles: 'box', dmgType: 'arts', skill: 'philae_2' }); // box: the 3×3 tiles
|
||
}, { owner: unit });
|
||
},
|
||
};
|
||
},
|
||
};
|