feedback5: merge O5 — 自选 kits for 左乐, 重岳 and 煌; engine hook hpDamage after the shields (typed shields from O8 kept: absorbShields(…, type)); SIM.md / damage.js headers take both; golden: only diy moved
This commit is contained in:
commit
aebca2f6d8
12 files changed
+2157
-131
No files matched your search
+4
-1
@@ -680,7 +680,9 @@ PRTS 异常效果: 无法选择 effects "仅在选择时生效"); checked before
|
||||
with `ceil(final) ≥ BOSS_HIT_LIMIT` (300000, shared/constants.js) is cancelled whole: returns 0 before shields (阿利斯泰尔's
|
||||
`boss:vest` barrier stays untouched; a `hit`-step block such as 假想敌:再生's aura acts earlier) [ASSUMED order], no HP /
|
||||
pool loss, no credit or stats, no `dmg` event, no `damaged` / `fatal` / kill; an fx `hitCap` `{ id, n }` marks it and
|
||||
draws nothing; research 11) → shields (a typed one — buff `shieldType` — only for its damage type) → HP loss
|
||||
draws nothing; research 11) → shields (a typed one — buff `shieldType` — only for its damage type) → **`hpDamage`** (what
|
||||
passed the shields; a handler may only lower `amount` — the 伤判效果 that act after a barrier: 煌's 紧急除颤 HP floor, PRTS
|
||||
备注 "该伤害减少(伤害值-煌当前生命值+煌最大生命值×50%)点"; 左乐's 庇护 re-applied after his 行险 barrier; never for a 流失) → HP loss
|
||||
(boss units: routed to `sharedBoss.damage(playerId, amount)`; a pool left under 1 HP is emptied) → if HP ≤ 0: **`fatal`** (`ctx.prevented = true` keeps the
|
||||
unit at ≥ 1 HP) → **`damaged`** → SP-on-hurt / TAKE_DAMAGE → `kill` + `death`.
|
||||
|
||||
@@ -737,6 +739,7 @@ registration order. `battle.off(handle)` / `battle.off(name, fn)` / `battle.offO
|
||||
| `hit` | `{ source, target, dmg, credit }` | before mitigation; mutate `dmg` (not fired for gauge fills — see `elementHit`). `source` may be null (terrain; 无来源 `dmg.sourceless` bursts, whose `credit` names the unit credited) |
|
||||
| `elementHit` | `{ source, target, dmg }` | before a gauge fill (`dmg.type === 'element'`); mutate `dmg.amount`/`dmg.mul`, set `dmg.cancel` |
|
||||
| `damaged` | `{ source, target, amount, type, dmg, credit }` | after application (`amount` may be 0 when shielded); element fills too (with their source); 无来源: `source` null, `credit` set |
|
||||
| `hpDamage` | `{ source, target, amount, dmg, credit }` | a damage instance after shields, before the HP loss (§4; not a 流失): lower `amount` only (a raise is ignored) — HP floors / reductions ordered after a barrier (kits/ops/op-huang.js, op-zuole.js) |
|
||||
| `heal` | `{ source, target, amount, opts }` | mutable `amount` |
|
||||
| `fatal` | `{ unit, source, credit, dmg, amount, prevented }` | HP would reach 0 — set `prevented` (substitutes, kit savers, 不死 / 复活 items, 埃芒加德; 不屈 is a `death` hook). Fired by every HP loss of a unit without a boss pool — hits of any type, element bursts, 无来源 damage, `loseHp` 流失. Order: kits' own savers (10 … −60) → items' 不死 (坚固维式重锤 — once per deployment: `items/battle.js deploymentOf`, a key every deploy changes and an in-place 复活 changes too; one battle-level hook holds the running windows (`holdsUndying`), so a window outlasts a lend, DESIGN §21.21 — the lock `PRIO_REVIVE` −100 after the substitutes (−100, registered first), the running windows `PRIO_UNDYING_HELD` −99 before them: a 傀儡师 holding 不死 does not switch, PRTS 分支特性信息 傀儡师 "未持有不死的情况下", DESIGN §22.11) → items' 复活 (M3茧甲, `PRIO_RESPAWN` −101: PRTS "复活" acts on a knock-out, which a 不死 prevents) → 埃芒加德 (−110); both 复活 revive in place and call `revivedInPlace` (a new deployment for the lock) |
|
||||
| `dollSwitch` | `{ unit, reason, done }` | content switches a 傀儡师 to its <替身> now (归溟幽灵鲨 S2 "技能结束后立刻切换为<替身>": no lethal HP loss); its trait does it unless it already is one or is not on the field, and sets `done` |
|
||||
|
||||
@@ -95,6 +95,9 @@ export const OPERATOR_KIT_FILES = Object.freeze([
|
||||
'op-logos.js',
|
||||
'op-mantra.js',
|
||||
'op-veen.js',
|
||||
'op-zuole.js',
|
||||
'op-chyue.js',
|
||||
'op-huang.js',
|
||||
]);
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
// server/sim/content/kits/ops/op-chyue.js — 重岳 (char_2024_chyue) 自选 operator kit: 6★ 斗士 (近卫), an owned-6★ pick of
|
||||
// the tier-5 and tier-6 自选 slots; every skill, both talents, the trait and both modules at every form.
|
||||
// Kit contract and the 自选 rules: ../README.md ("How to add an operator (自选)").
|
||||
//
|
||||
// Forms (data/backups.json units.char_2024_chyue, the DIY slot statuses): normal = E2 Lv1, skills at rank 4, no module;
|
||||
// elite = E2 Lv60, rank 7, the picked module at stage 1 (tier 5) or 3 (tier 6). Potential 0 [ASSUMED: no account].
|
||||
// Sources: character_table / skill_table / battle_equip_table (zh_CN, as built into backups.json); PRTS 重岳 (talent and
|
||||
// skill 备注); the client's buff templates (buff_template_data `chyue_t_1` / `_passive`, `chyue_t_2` / `_sp`,
|
||||
// `chyue_e_002_t[unkill]`, `chyue_s_1_enhance_judge`, `chyue_s_2_levitate` / `_finish_levitate` / `_atk_scale`,
|
||||
// `chyue_s_3_enhance` / `_trigger` / `_end_check`); Arknights Terra Wiki "Chongyue".
|
||||
// - Trait (斗士) "能够阻挡一个敌人": the profession default (block 1, melee, ground only). Module FGT-X "拥有15%的物理闪避"
|
||||
// (trait bb prob): a permanent physical dodge. Module FGT-Y "生命值高于50%时攻击速度+10" (trait bb attack_speed /
|
||||
// hp_ratio): ASPD while HP > hp_ratio.
|
||||
// - T1 止戈 "对目标普通攻击时,有23%的概率使重岳2.5秒内对其造成的伤害提升65%" (bb prob / damage_scale / up_duration):
|
||||
// chyue_t_1 rolls on every damage instance a normal attack outputs (PRTS 备注 "于普通攻击每次造成伤害时独立触发,重复施加
|
||||
// 时仅刷新持续时间" — after it lands, so not for that instance) and marks the target for up_duration s (his own mark:
|
||||
// independentCharacterSource); chyue_t_1_passive: every damage of his to a marked enemy × damage_scale (DamageScale, a
|
||||
// final multiplier — skills included). FGT-Y stage 3: damage_scale 1.75. S2's second segment marks at 100 %.
|
||||
// - T2 万象为宾 "若重岳释放一次技能击倒不少于一个敌人,则回复3点技力" (bb sp): PRTS 备注 — only a kill by skill damage counts,
|
||||
// judged when the skill (or an ability of it) finishes; the SP ignores 阻回 (ModifySp forceFlag). FGT-X stage 3:
|
||||
// 4 SP, and "未击倒敌人时变为回复1点技力" (the hidden part's sp: chyue_e_002_t[unkill]). S2's second segment is judged on
|
||||
// its own (PRTS: "第二段攻击打出时恢复一次SP…只与这第二段攻击是否击杀了敌人有关").
|
||||
// - S1 冲盈 (MANUAL, attack SP, 可充能 3 次; data DEFAULT): the next attack strikes its target for atk_scale × ATK; cast
|
||||
// from a full stack (蓄力, chyue_s_1_enhance_judge: ≥ 3 charges) it spends every charge (ClearCharacterSp) and strikes
|
||||
// `times` times.
|
||||
// - S2 拂尘 (MANUAL, 可充能 2 次; data SKILL_RANGE on its x-4): at once up to max_target enemies around him (PRTS 备注
|
||||
// "可对空,优先选择自身第一天赋生效中的>自身阻挡的>仇恨值最高的敌人") take atk_scale × ATK physical, and those he marked are
|
||||
// 浮空 for 2 s (chyue_s_2_levitate: ground enemies only — the engine refuses data flyers); then the second segment
|
||||
// (SecAttack, outside the skill — 0.5 s later: his skeleton's Skill_2_Begin hits at 0.367 s of its 0.833 s, Skill_2_End
|
||||
// at 0.033 s): every 浮空 enemy around him loses every 浮空 buff (chyue_s_2_finish_levitate), takes atk_scale_down × ATK
|
||||
// physical and gets his mark (100 %, after that damage). The first segment lands at the cast [ASSUMED: the kits'
|
||||
// instant convention — the clip's 0.367 s wind-up is not modelled].
|
||||
// - S3 我无 (MANUAL, attack SP; data DEFAULT): the next attack strikes its target and the ground enemies within 0.8 of it
|
||||
// (PRTS 备注 "溅射半径0.8"; the skill cannot hit air) for atk_scale × ATK. Its cast_cnt-th cast of a deployment turns him
|
||||
// (【变身】, chyue_s_3_end_check — "第五次开启本技能时【变身】(每次部署单独计算)"; that cast keeps its single strike, the
|
||||
// text's "累计使用五次技能后"): his range becomes x-6, every normal attack hits twice and gives 1 more SP ignoring 阻回
|
||||
// (chyue_s_3_enhance), the skill fires by itself the moment its SP is full and a normal-attack target exists
|
||||
// (chyue_s_3_trigger TriggerSkill, checked every frame: not the 3 s automatic-operation cooldown) and its strike lands
|
||||
// twice. The fixed animation (不受攻击速度影响) is modelled as one attack interval [ASSUMED].
|
||||
|
||||
import { num, talentBb, moduleBb, traitBb, up, onHitBy, statBuff, toggleBuff, skillRec } from '../shared/tier1.js';
|
||||
import { absoluteRangeKeys, sortEnemyTargets } from '../../../targeting.js';
|
||||
import { hasHp, isHpLoss } from '../../../damage.js';
|
||||
|
||||
const S1 = 'skchr_chyue_1';
|
||||
const S2 = 'skchr_chyue_2';
|
||||
const S3 = 'skchr_chyue_3';
|
||||
/** S2's 技能范围 when the data carries none (x-4: the 8 tiles around him and his own). */
|
||||
const X4 = Object.freeze([[1, -1], [1, 0], [1, 1], [0, -1], [0, 0], [0, 1], [-1, -1], [-1, 0], [-1, 1]]);
|
||||
/** His range after the S3 【变身】 (PRTS 备注 "攻击范围扩大至 x-6"; range_table x-6). */
|
||||
const X6 = Object.freeze([[2, 0], [1, 0], [0, -2], [0, -1], [0, 0], [0, 1], [0, 2], [-1, 0], [-2, 0]]);
|
||||
/** S3 "溅射半径0.8" (PRTS 备注). */
|
||||
const S3_SPLASH = 0.8;
|
||||
/** S2 浮空 "持续2s" (PRTS 备注; chyue_s_2_levitate lifeTime 2). */
|
||||
const S2_LEVITATE = 2;
|
||||
/** S2's second segment after the first: the skeleton's OnAttack events (Skill_2_Begin 0.367 / 0.833 s, Skill_2_End 0.033 s). */
|
||||
const S2_SECOND_DELAY = 0.833 + 0.033 - 0.367;
|
||||
|
||||
const bbOf = (chess, id) => skillRec(chess, id)?.bb ?? {};
|
||||
const markKey = (unit) => `talent:chyue:mark#${unit.id}`;
|
||||
const marked = (unit, e) => !!e.findBuff(markKey(unit));
|
||||
|
||||
export default {
|
||||
char_2024_chyue: (bb, chess, def) => {
|
||||
const tb = traitBb(chess);
|
||||
const t0 = talentBb(chess, 0), t1 = talentBb(chess, 1);
|
||||
const hb = moduleBb(chess); // FGT-X stage 3: sp when the skill killed nobody
|
||||
const b1 = bbOf(chess, S1), b2 = bbOf(chess, S2), b3 = bbOf(chess, S3);
|
||||
const s2 = skillRec(chess, S2);
|
||||
const picked = def?.skill?.id ?? chess?.skill?.skillId ?? null;
|
||||
const castCnt = Math.max(1, Math.floor(num(b3.cast_cnt, 5)));
|
||||
const mark = (battle, unit, e) => {
|
||||
if (hasHp(e)) battle.addBuff(e, { key: markKey(unit), duration: num(t0.up_duration, 2.5), refresh: 'replace', source: unit, tags: ['talent'] });
|
||||
};
|
||||
/** 万象为宾: the SP of a finished skill / segment (a kill by his skill damage: sp, else the FGT-X stage 3 part). */
|
||||
const settle = (unit) => {
|
||||
const killed = !!unit.mem.chyueKilled;
|
||||
unit.mem.chyueKilled = false;
|
||||
const n = killed ? num(t1.sp) : num(hb.sp);
|
||||
if (n > 0 && up(unit) && unit.skill) unit.skill.gainSp(n, 'init'); // ModifySp forceFlag: 阻回 does not stop it
|
||||
};
|
||||
const s2Keys = (unit) => absoluteRangeKeys(s2?.rangeGrid?.length ? s2.rangeGrid : X4, unit.tileR, unit.tileC, unit.dir, 0);
|
||||
/** S2's second segment (SecAttack). */
|
||||
const secondSegment = (battle, unit, seq) => {
|
||||
if (!up(unit) || unit.deploySeq !== seq) return;
|
||||
unit.mem.chyueKilled = false;
|
||||
const atk = unit.s.atk;
|
||||
const lifted = battle.enemiesInKeys(s2Keys(unit), unit, { canHitFly: true }).filter((e) => e.s.flags.levitate);
|
||||
if (lifted.length) battle.fx('aoe', { x: unit.x, y: unit.y, radius: 1.5, id: unit.id, skill: 'chyue:down' });
|
||||
for (const e of lifted) {
|
||||
for (const b of e.buffs.slice()) if (b.flags && b.flags.levitate) battle.removeBuff(e, b);
|
||||
if (!e.alive) continue;
|
||||
battle.dealDamage(unit, e, { amount: atk * num(b2.atk_scale_down, 1), type: 'phys', isSkill: true, tags: ['skill'] });
|
||||
mark(battle, unit, e);
|
||||
}
|
||||
settle(unit);
|
||||
};
|
||||
/** After the S3 【变身】: x-6, double hits, +1 SP per attack, the self-cast. */
|
||||
const awaken = (battle, unit) => {
|
||||
unit.mem.chyueAwake = true;
|
||||
unit.rangeGrid = X6;
|
||||
battle.refreshRange(unit);
|
||||
battle.fx('buff', { x: unit.x, y: unit.y, id: unit.id, kind: 'atk' });
|
||||
};
|
||||
return {
|
||||
skills: {
|
||||
[S1]: {
|
||||
kind: 'charges',
|
||||
attack: { atkScale: num(b1.atk_scale, 1), hitsFn: (b, u) => u.mem.chyueS1Hits || 1 },
|
||||
onStart({ unit, skill }) {
|
||||
// 蓄力: the cast took one charge of a full stack ⇒ the rest goes too and the strike lands `times` times
|
||||
const full = skill.maxCharges > 1 && skill.charges === skill.maxCharges - 1;
|
||||
unit.mem.chyueS1Hits = full ? Math.max(1, Math.floor(num(b1.times, skill.maxCharges))) : 1;
|
||||
if (full) { skill.charges = 0; skill.sp = 0; }
|
||||
},
|
||||
onEnd({ unit }) { unit.mem.chyueS1Hits = 1; settle(unit); },
|
||||
},
|
||||
[S2]: {
|
||||
kind: num(s2?.maxChargeTime, 1) > 1 ? 'charges' : 'instant',
|
||||
onStart({ battle, unit }) {
|
||||
unit.mem.chyueKilled = false;
|
||||
const foes = battle.enemiesInKeys(s2Keys(unit), unit, { canHitFly: true });
|
||||
sortEnemyTargets(battle, unit, foes, null); // the ones he blocks first, then aggro
|
||||
foes.sort((a, b) => (marked(unit, b) ? 1 : 0) - (marked(unit, a) ? 1 : 0)); // his marked ones before them (stable)
|
||||
const atk = unit.s.atk;
|
||||
battle.fx('aoe', { x: unit.x, y: unit.y, radius: 1.5, id: unit.id, skill: 'chyue:whisk' });
|
||||
for (const e of foes.slice(0, Math.max(1, Math.floor(num(b2.max_target, 4))))) {
|
||||
if (!e.alive) continue;
|
||||
const lift = marked(unit, e);
|
||||
battle.dealDamage(unit, e, { amount: atk * num(b2.atk_scale, 1), type: 'phys', isSkill: true, tags: ['skill'] });
|
||||
if (lift && e.alive) battle.applyStatus(e, 'levitate', { duration: S2_LEVITATE, source: unit });
|
||||
}
|
||||
const seq = unit.deploySeq;
|
||||
battle.after(S2_SECOND_DELAY, () => secondSegment(battle, unit, seq), { owner: unit });
|
||||
},
|
||||
onEnd({ unit }) { settle(unit); },
|
||||
},
|
||||
[S3]: {
|
||||
kind: 'instant',
|
||||
attack: {
|
||||
atkScale: num(b3.atk_scale, 1), splashRadius: S3_SPLASH, hitsFn: () => 1,
|
||||
onHit({ battle, unit, target, x, y }) {
|
||||
if (!unit.mem.chyueAwake) return;
|
||||
// after the 【变身】 the strike lands once more: its target and the ground enemies within 0.8 of it
|
||||
const amount = unit.s.atk * num(b3.atk_scale, 1);
|
||||
const cx = target ? target.x : x, cy = target ? target.y : y;
|
||||
if (target && target.alive) battle.dealDamage(unit, target, { amount, type: 'phys', isSkill: true, tags: ['skill'] });
|
||||
for (const e of battle.foesInRadius(cx, cy, S3_SPLASH, true)) {
|
||||
if (e === target || !e.alive || e.isFlying || e.s.flags.untargetable) continue;
|
||||
battle.dealDamage(unit, e, { amount, type: 'phys', isSkill: true, isSplash: true, tags: ['skill'] });
|
||||
}
|
||||
},
|
||||
},
|
||||
onStart({ unit }) { unit.mem.chyueCasts = (unit.mem.chyueCasts || 0) + 1; },
|
||||
onEnd({ battle, unit }) {
|
||||
settle(unit);
|
||||
if (!unit.mem.chyueAwake && unit.mem.chyueCasts >= castCnt && up(unit)) awaken(battle, unit);
|
||||
},
|
||||
},
|
||||
},
|
||||
talents: [
|
||||
{ install(battle, unit) { // 止戈
|
||||
const p = num(t0.prob), scale = num(t0.damage_scale, 1);
|
||||
if (scale !== 1) onHitBy(battle, unit, ({ target, dmg }) => { if (marked(unit, target)) dmg.mul *= scale; });
|
||||
if (!(p > 0)) return;
|
||||
battle.on('damaged', (c) => {
|
||||
const e = c.target, d = c.dmg;
|
||||
if (c.source !== unit || !e || e.side !== 'enemy' || !d || !d.isAttack || d.isSkill || isHpLoss(d) || c.type === 'element' || !hasHp(e)) return;
|
||||
if (battle.rng.chance(p)) mark(battle, unit, e);
|
||||
}, { owner: unit });
|
||||
} },
|
||||
{ install(battle, unit) { // 万象为宾: a kill by his skill damage, for the running skill / segment (settle)
|
||||
battle.on('damaged', (c) => {
|
||||
if (c.source === unit && c.dmg && c.dmg.isSkill && c.target && c.target.side === 'enemy' && !hasHp(c.target)) unit.mem.chyueKilled = true;
|
||||
}, { owner: unit });
|
||||
} },
|
||||
],
|
||||
// the S3 【变身】's double hit (normal attacks only: S1 / S3 strikes set their own hits)
|
||||
trait: picked === S3 ? { hitsFn: (b, u) => (u.mem.chyueAwake ? 2 : 1) } : undefined,
|
||||
install(battle, unit) {
|
||||
// FGT-X 物理闪避 / FGT-Y 生命值高于50%时攻击速度+10
|
||||
if (num(tb.prob) > 0) statBuff(battle, unit, 'trait:chyue:dodge', { dodgePhys: num(tb.prob) });
|
||||
if (num(tb.attack_speed)) toggleBuff(battle, unit, 'trait:chyue:aspd', () => unit.hpRatio > num(tb.hp_ratio, 0.5), { aspd: num(tb.attack_speed) });
|
||||
// every deployment starts untransformed with no cast counted (每次部署单独计算)
|
||||
battle.on('deploy', ({ unit: u }) => {
|
||||
if (u !== unit) return;
|
||||
unit.mem.chyueCasts = 0;
|
||||
unit.mem.chyueAwake = false;
|
||||
unit.mem.chyueS1Hits = 1;
|
||||
unit.mem.chyueKilled = false;
|
||||
const own = unit.def?.rangeGrid;
|
||||
if (own && unit.rangeGrid !== own) { unit.rangeGrid = own; battle.refreshRange(unit); }
|
||||
}, { owner: unit });
|
||||
if (picked !== S3) return;
|
||||
// 【变身】: +1 SP per normal attack (阻回 ignored) and the self-cast the moment SP and a target are there
|
||||
battle.on('attack', (c) => {
|
||||
if (c.attacker === unit && !c.isSkill && unit.mem.chyueAwake && unit.skill) unit.skill.gainSp(1, 'init');
|
||||
}, { owner: unit });
|
||||
battle.on('tick', () => {
|
||||
const sk = unit.skill;
|
||||
if (!unit.mem.chyueAwake || !sk || !up(unit) || !unit.canAct || !sk.ready || sk.pending || unit.s.flags.silence) return;
|
||||
const prof = battle.effectiveProfile(unit);
|
||||
if (!battle.enemiesInKeys(unit.rangeKeys, unit, prof).length && !battle.blockedTargets(unit, prof).length) return;
|
||||
if (!sk.activate('awake')) return;
|
||||
if (battle.forceAttack(unit)) unit.atkCd = Math.max(unit.atkCd, unit.s.interval);
|
||||
}, { owner: unit });
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,209 @@
|
||||
// server/sim/content/kits/ops/op-huang.js — 煌 (char_017_huang) 自选 operator kit: 6★ 强攻手 (近卫), an owned-6★ pick of
|
||||
// the tier-5 and tier-6 自选 slots; every skill, both talents, the trait and both modules at every form.
|
||||
// Kit contract and the 自选 rules: ../README.md ("How to add an operator (自选)").
|
||||
//
|
||||
// Forms (data/backups.json units.char_017_huang, the DIY slot statuses): normal = E2 Lv1, skills at rank 4, no module;
|
||||
// elite = E2 Lv60, rank 7, the picked module at stage 1 (tier 5) or 3 (tier 6). Potential 0 [ASSUMED: no account].
|
||||
// Sources: character_table / skill_table / battle_equip_table (zh_CN, as built into backups.json); PRTS 煌 (talent and
|
||||
// skill 备注, the CEN-X note); the client's buff templates (buff_template_data `huang_s_3`, `huang_t_1[heal]` / `[lock]`,
|
||||
// `huang_e_003[lock]` / `[heal]`, `huang_t_2…`); Arknights Terra Wiki "Blaze" (the S3 notes).
|
||||
// - Trait (强攻手) "同时攻击阻挡的所有敌人": the profession default (centurion `hitAllBlocked`, block 3). Module CEN-X
|
||||
// "攻击被阻挡的敌人攻击力提升至110%" (trait bb atk_scale): PRTS "于每次计算伤害时检查目标是否处于阻挡/被阻挡状态…提升效果
|
||||
// 为攻击力倍率提升" — every damage instance of hers whose target is blocked (by anyone) takes ×atk_scale on its ATK-based
|
||||
// amount (before DEF): normal attacks, S1, the S3 cuts and burst. Module CEN-Y "生命值高于50%时受到的物理伤害降低20%"
|
||||
// (trait bb hp_ratio / damage_resistance): physical damage taken × (1 − damage_resistance) while HP > hp_ratio.
|
||||
// - T1 紧急除颤 "在生命值低于25%时,仅一次回复50%的生命值并在6秒内使生命值不低于50%" (bb hp_ratio,
|
||||
// huang_t_1[heal].hp_ratio, huang_t_1[lock].min_hp_ratio / .duration). PRTS 备注: every deployment she holds 不死 until
|
||||
// the first time her HP ratio is ≤ hp_ratio; then the heal (max HP × [heal].hp_ratio, a heal — huang_t_1[heal]
|
||||
// HealViaMaxHpRatio) and for [lock].duration s every damage that would take her below [lock].min_hp_ratio × max HP is
|
||||
// cut to what is left above it ("该伤害减少(伤害值-煌当前生命值+煌最大生命值×50%)点": the `hpDamage` hook after the
|
||||
// shields — a 伤判效果, so a 流失 such as her S3's is not held). CEN-Y stage 3 (talent hp_ratio 0.5 + the hidden
|
||||
// huang_e_003[lock] part): "在生命值首次低于25%、50%时…8秒内…": the talent fires at 50 %, and a second trigger at
|
||||
// check_hp_ratio (25 %) with its own 不死 (huang_e_003[undead]) fires only once the first is spent ("生命值首次低于50%
|
||||
// 始终先于…25%生效"), re-checking the HP after the first one's heal [ASSUMED: both read the current HP]; its heal is
|
||||
// skipped while the first lock runs (huang_e_003[heal] "CheckContainsBuff huang_t_1[lock] → IfNot → heal"). The hidden
|
||||
// part's hp_ratio / def_penetrate_fixed (CEN-Y stage 2+): "生命值高于50%时攻击无视目标150点防御力" — a defIgnoreFlat
|
||||
// buff while HP > hp_ratio (every damage of hers).
|
||||
// - T2 严酷训练 "在战场停留15秒后获得抵抗" (bb one_minus_status_resistance, interval): `interval` s after each deployment
|
||||
// the engine 抵抗 (huang_t_2 creates status_resistance[inf]: control statuses last half as long) until she leaves.
|
||||
// CEN-X stage 3 adds "30秒后攻击力+6%,45秒后攻速+12" (huang_t_2[e_002_atk].atk / .interval, [e_002_atk_speed]
|
||||
// .attack_speed / .interval: an ATK MULTIPLIER and an ATTACK_SPEED ADDITION, INFINITY lifetime).
|
||||
// - S1 强力击·γ型 (AUTO, attack SP): the next attack at atk_scale × ATK — every blocked enemy it hits (her trait); the
|
||||
// data's DEFAULT trigger (an AUTO "next attack" waits for her attack).
|
||||
// - S2 链锯延伸模块 (AUTO, 持续时间无限): ATK +atk, DEF +def and the skill range 2-2 for the rest of the deployment (PRTS 备注
|
||||
// "攻击距离加长…使用技能提供的攻击范围(非攻击距离+1)"); an AUTO skill acting on herself only fires as soon as its SP is
|
||||
// full (the owner's AUTO rule, kits/README.md checklist 5).
|
||||
// - S3 沸腾爆裂 (MANUAL, data DEFAULT): a 维持技能状态 (PRTS 游戏数据基础: no normal attack while it runs; its cadence
|
||||
// follows the animation — no attack speed change touches it — and a hard control (晕眩 / 冻结 …) ends it early).
|
||||
// PRTS 备注 + huang_s_3: every second for the first 8 s the ATK / DEF bonus is updated, then one physical cut hits every
|
||||
// ground enemy of her attack range ("对前方一格内的敌方单位进行切割" — her own 1-1 and the enemies she blocks; 不可对空;
|
||||
// 100 % ATK [ASSUMED: no blackboard key — her attack's own damage]); the bonus is atk / def × min(1, t ÷ (duration −
|
||||
// 1.05)) at the t-th update (huang_s_3 RemainingRatioToAttributeModifier `_endTime` 1.05: full at 8.95 s; the Terra
|
||||
// Wiki's "reaches maximum after 8.95 seconds"); at 9 s it reaches the maximum and the finish follows (PRTS "9s时…";
|
||||
// Terra "triggered at the 9 seconds mark"; her skeleton, whose Skill_2_* clips are S3's: the 3 s Skill_2_Loop_End's
|
||||
// last OnAttack falls at 9 s of the 10 s run — Begin 1.4 s + the 0.4 s loops to 7 s): the huang_s_3 ON_SKILL_FINISH part, she loses hp_ratio ×
|
||||
// MAX HP (DamageViaMaxHpRatio, undeadable — never below 1 HP; PRTS calls it 流失) and then every enemy of the 3 × 3
|
||||
// area ahead (PRTS "前方3×3区域 3-6…碰撞判定,可对空": air units too) takes damage_by_atk_scale × her ATK at that
|
||||
// moment, physical; the state runs on to its 10 s. A run cut short by a hard control finishes at once
|
||||
// [ASSUMED: ON_SKILL_FINISH fires on any end but her knock-out]. The range the game shows while it runs is the
|
||||
// burst's 3-6 (PRTS); the data has no skill range and the cuts use her own, so the card keeps her 1-1 and the trigger
|
||||
// stays DEFAULT.
|
||||
|
||||
import { num, talentBb, moduleBb, traitBb, up, onHitBy, onHitOn, toggleBuff, skillRec } from '../shared/tier1.js';
|
||||
import { absoluteRangeKeys } from '../../../targeting.js';
|
||||
|
||||
const S1 = 'skchr_huang_1';
|
||||
const S2 = 'skchr_huang_2';
|
||||
const S3 = 'skchr_huang_3';
|
||||
/** S3's final area "前方3×3区域" (PRTS 备注 range 3-6; range_table): her tile, the two ahead and the rows beside them. */
|
||||
const GRID_3_6 = Object.freeze([[1, 0], [1, 1], [1, 2], [0, 0], [0, 1], [0, 2], [-1, 0], [-1, 1], [-1, 2]]);
|
||||
/** huang_s_3 RemainingRatioToAttributeModifier `_endTime`: the ramp is full this long before the run's nominal end. */
|
||||
const S3_RAMP_END = 1.05;
|
||||
/** S3 updates: eight cuts (1 s apart), then the finish at the ninth (PRTS "9s时"). */
|
||||
const S3_CYCLES = 9;
|
||||
const S3_BUFF = 'skill:huang:ramp';
|
||||
|
||||
const bbOf = (chess, id) => skillRec(chess, id)?.bb ?? {};
|
||||
|
||||
export default {
|
||||
char_017_huang: (bb, chess, def) => {
|
||||
const tb = traitBb(chess);
|
||||
const t0 = talentBb(chess, 0), t1 = talentBb(chess, 1);
|
||||
const hb = moduleBb(chess); // CEN-Y stage 2+: hp_ratio / def_penetrate_fixed; stage 3: huang_e_003[lock].*
|
||||
const b1 = bbOf(chess, S1), b2 = bbOf(chess, S2), b3 = bbOf(chess, S3);
|
||||
const s2 = skillRec(chess, S2);
|
||||
const ownGrid = chess?.rangeGrid ?? def?.rangeGrid ?? [[0, 0], [0, 1]];
|
||||
/** The ground enemies her own range holds and the ones she blocks (the S3 cuts). */
|
||||
const cutTargets = (battle, unit) => {
|
||||
const keys = absoluteRangeKeys(unit.rangeGrid || ownGrid, unit.tileR, unit.tileC, unit.dir, unit.s.rangeExtend || 0);
|
||||
const list = battle.enemiesInKeys(keys, unit, { canHitFly: false });
|
||||
for (const e of battle.blockedTargets(unit, { canHitFly: false })) if (!list.includes(e)) list.push(e);
|
||||
return list;
|
||||
};
|
||||
/** S3's finish (huang_s_3 ON_SKILL_FINISH): the 流失 first (undeadable), then the burst at her ATK of that moment. */
|
||||
const finish = (battle, unit, s) => {
|
||||
s.done = true;
|
||||
const loss = Math.min(unit.s.maxHp * num(b3.hp_ratio), unit.hp - 1);
|
||||
if (loss > 0) battle.loseHp(unit, loss, { source: unit });
|
||||
if (!up(unit)) return;
|
||||
const atk = unit.s.atk;
|
||||
const keys = absoluteRangeKeys(GRID_3_6, unit.tileR, unit.tileC, unit.dir, 0);
|
||||
battle.fx('aoe', { x: unit.x, y: unit.y, radius: 1.5, id: unit.id, skill: 'huang:burst' });
|
||||
for (const e of battle.enemiesInKeys(keys, unit, { canHitFly: true })) {
|
||||
if (e.alive) battle.dealDamage(unit, e, { amount: atk * num(b3.damage_by_atk_scale, 1), type: 'phys', isSkill: true, tags: ['skill'] });
|
||||
}
|
||||
};
|
||||
const setRamp = (battle, unit, r) => {
|
||||
const b = unit.findBuff(S3_BUFF);
|
||||
if (!b) return;
|
||||
b.mods = { atkPct: num(b3.atk) * r, defPct: num(b3.def) * r };
|
||||
unit.markDirty();
|
||||
};
|
||||
return {
|
||||
skills: {
|
||||
[S1]: { kind: 'instant', attack: { atkScale: num(b1.atk_scale, 1) } },
|
||||
[S2]: {
|
||||
kind: 'toggle', trigger: 'SP_FULL',
|
||||
mods: { atkPct: num(b2.atk), defPct: num(b2.def) },
|
||||
...(s2?.rangeGrid?.length ? { targeting: { rangeGrid: s2.rangeGrid } } : {}),
|
||||
onStart({ battle, unit }) { battle.fx('buff', { x: unit.x, y: unit.y, id: unit.id, kind: 'atk' }); },
|
||||
},
|
||||
[S3]: {
|
||||
kind: 'duration',
|
||||
attack: { noAttack: true },
|
||||
onStart({ battle, unit }) {
|
||||
unit.mem.huangS3 = { t: 0, k: 0 };
|
||||
battle.addBuff(unit, { key: S3_BUFF, mods: { atkPct: 0, defPct: 0 }, tags: ['skill'], visible: true });
|
||||
},
|
||||
onTick({ battle, unit, skill, dt }) {
|
||||
const s = unit.mem.huangS3;
|
||||
if (!s) return;
|
||||
// 维持技能状态: a hard control ends it early (PRTS 游戏数据基础 "眩晕、冻结等硬性控制会提前结束")
|
||||
if (!unit.canAct || unit.s.flags.sleep) { skill.end('interrupted'); return; }
|
||||
s.t += dt;
|
||||
while (s.k < S3_CYCLES && s.t >= s.k + 1 - 1e-9) {
|
||||
s.k++;
|
||||
setRamp(battle, unit, Math.min(1, s.k / Math.max(1e-6, skill.duration - S3_RAMP_END)));
|
||||
if (s.k >= S3_CYCLES) { finish(battle, unit, s); return; }
|
||||
const foes = cutTargets(battle, unit);
|
||||
if (foes.length) battle.fx('aoe', { x: unit.x, y: unit.y, radius: 0.6, id: unit.id, skill: 'huang:cut' });
|
||||
for (const e of foes) if (e.alive) battle.dealDamage(unit, e, { amount: unit.s.atk, type: 'phys', isSkill: true, tags: ['skill'] });
|
||||
}
|
||||
},
|
||||
onEnd({ battle, unit, reason }) {
|
||||
const s = unit.mem.huangS3;
|
||||
unit.mem.huangS3 = null;
|
||||
if (s && !s.done && reason !== 'death' && up(unit)) finish(battle, unit, s); // cut short: it finishes at once
|
||||
battle.removeBuff(unit, S3_BUFF);
|
||||
},
|
||||
},
|
||||
},
|
||||
talents: [
|
||||
{ install(battle, unit) { // 紧急除颤 (+ CEN-Y stage 3's second trigger and stage 2+'s 防御穿透)
|
||||
const trig = num(t0.hp_ratio, 0.25);
|
||||
const healA = num(t0['huang_t_1[heal].hp_ratio'], 0.5);
|
||||
const floorA = num(t0['huang_t_1[lock].min_hp_ratio'], 0.5), durA = num(t0['huang_t_1[lock].duration'], 6);
|
||||
const second = hb['huang_e_003[lock].check_hp_ratio'] != null;
|
||||
const trigB = num(hb['huang_e_003[lock].check_hp_ratio'], 0.25);
|
||||
const healB = num(hb['huang_e_003[lock].hp_ratio'], 0.5);
|
||||
const floorB = num(hb['huang_e_003[lock].min_hp_ratio'], 0.5), durB = num(hb['huang_e_003[lock].duration'], 8);
|
||||
const st = { undeadA: false, undeadB: false, lockA: -Infinity, lockB: -Infinity };
|
||||
unit.mem.huangDefib = st;
|
||||
battle.on('deploy', ({ unit: u }) => {
|
||||
if (u !== unit) return;
|
||||
st.undeadA = true;
|
||||
st.undeadB = second;
|
||||
st.lockA = st.lockB = -Infinity;
|
||||
}, { owner: unit });
|
||||
// 不死 while a trigger is unspent: a lethal hit leaves her at 1 HP (the trigger check below follows)
|
||||
battle.on('fatal', (c) => { if (c.unit === unit && !c.prevented && (st.undeadA || st.undeadB)) c.prevented = true; }, { owner: unit });
|
||||
battle.on('hpDamage', (c) => {
|
||||
if (c.target !== unit) return;
|
||||
const t = battle.time;
|
||||
const floor = Math.max(t < st.lockA ? floorA : 0, t < st.lockB ? floorB : 0);
|
||||
if (floor > 0) c.amount = Math.min(c.amount, Math.max(0, unit.hp - floor * unit.s.maxHp));
|
||||
}, { owner: unit });
|
||||
battle.on('damaged', (c) => {
|
||||
if (c.target !== unit || !up(unit)) return;
|
||||
if (st.undeadA && unit.hpRatio <= trig + 1e-9) {
|
||||
st.undeadA = false;
|
||||
st.lockA = battle.time + durA;
|
||||
battle.heal(unit, unit, unit.s.maxHp * healA, { self: true, tags: ['talent'] });
|
||||
battle.fx('heal', { x: unit.x, y: unit.y, id: unit.id });
|
||||
}
|
||||
if (st.undeadB && !st.undeadA && unit.hpRatio <= trigB + 1e-9) {
|
||||
st.undeadB = false;
|
||||
st.lockB = battle.time + durB;
|
||||
if (!(battle.time < st.lockA)) battle.heal(unit, unit, unit.s.maxHp * healB, { self: true, tags: ['talent'] });
|
||||
battle.fx('heal', { x: unit.x, y: unit.y, id: unit.id });
|
||||
}
|
||||
}, { owner: unit });
|
||||
const pen = num(hb.def_penetrate_fixed);
|
||||
if (pen > 0) toggleBuff(battle, unit, 'talent:huang:defPen', () => unit.hpRatio > num(hb.hp_ratio, 0.5), { defIgnoreFlat: pen });
|
||||
} },
|
||||
{ install(battle, unit) { // 严酷训练 (+ CEN-X stage 3: ATK after 30 s, ASPD after 45 s)
|
||||
const resAt = num(t1['huang_t_2.interval'], num(t1.interval, 15));
|
||||
const res = Math.min(0.95, Math.max(0, -num(t1['huang_t_2.one_minus_status_resistance'], num(t1.one_minus_status_resistance))));
|
||||
const atk = num(t1['huang_t_2[e_002_atk].atk']), atkAt = num(t1['huang_t_2[e_002_atk].interval']);
|
||||
const as = num(t1['huang_t_2[e_002_atk_speed].attack_speed']), asAt = num(t1['huang_t_2[e_002_atk_speed].interval']);
|
||||
battle.on('deploy', ({ unit: u }) => {
|
||||
if (u !== unit) return;
|
||||
const seq = unit.deploySeq;
|
||||
const at = (s, fn) => battle.after(s, () => { if (up(unit) && unit.deploySeq === seq) fn(); }, { owner: unit });
|
||||
if (res > 0) at(resAt, () => battle.applyStatus(unit, 'resist', { value: res, source: unit }));
|
||||
if (atk) at(atkAt, () => battle.addBuff(unit, { key: 'talent:huang:atk', mods: { atkPct: atk }, tags: ['talent'] }));
|
||||
if (as) at(asAt, () => battle.addBuff(unit, { key: 'talent:huang:aspd', mods: { aspd: as }, tags: ['talent'] }));
|
||||
}, { owner: unit });
|
||||
} },
|
||||
],
|
||||
install(battle, unit) {
|
||||
// CEN-X: ×atk_scale on her ATK-based damage to a blocked enemy (every damage calculation)
|
||||
const blockedMul = num(tb.atk_scale, 1);
|
||||
if (blockedMul !== 1) onHitBy(battle, unit, ({ target, dmg }) => { if (target.blockedBy) dmg.amount *= blockedMul; });
|
||||
// CEN-Y: 生命值高于50%时受到的物理伤害降低20%
|
||||
const dr = num(tb.damage_resistance);
|
||||
if (dr > 0) onHitOn(battle, unit, ({ dmg }) => { if (dmg.type === 'phys' && unit.hpRatio > num(tb.hp_ratio, 0.5)) dmg.mul *= 1 - dr; });
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,234 @@
|
||||
// server/sim/content/kits/ops/op-zuole.js — 左乐 (char_4121_zuole) 自选 operator kit: 6★ 武者 (近卫), an owned-6★ pick of
|
||||
// the tier-5 and tier-6 自选 slots; every skill, both talents, the trait and both modules at every form.
|
||||
// Kit contract and the 自选 rules: ../README.md ("How to add an operator (自选)").
|
||||
//
|
||||
// Forms (data/backups.json units.char_4121_zuole, the DIY slot statuses): normal = E2 Lv1, skills at rank 4, no module;
|
||||
// elite = E2 Lv60, rank 7, the picked module at stage 1 (tier 5) or 3 (tier 6). Potential 0 [ASSUMED: no account].
|
||||
// Sources: character_table / skill_table / battle_equip_table (zh_CN, as built into backups.json); PRTS 左乐 (S2 / S3
|
||||
// 备注); the client's buff templates (buff_template_data `zuole_trait`, `zuole_t_2`, `zuole_s_2[shield]` /
|
||||
// `[shield_core]`, `zuole_s_3` / `[shield]`, `zuole_e_002[resistance]`, `zuole_e_003_talent`, `zuole_e_003_trait`);
|
||||
// Arknights Terra Wiki "Zuo Le" (the barrier caps count each skill's own barrier only).
|
||||
// - Trait (武者) "不成为其他角色的治疗目标,每次攻击到敌人后回复自身70生命": the profession default (musha: no heal from
|
||||
// others, `value` per enemy hit; zuole_trait heals on every damage he outputs — the profession heals a normal attack
|
||||
// per target and any other damage per instance, so S1's extra strikes are separate damage instances).
|
||||
// - T1 秉烛照影 "在场时,自身获得最高+50攻击速度和技力自然回复速度+2/秒的坚忍(损失70%生命值时达到最大加成)" (bb
|
||||
// min_attack_speed / min_sp_recovery_per_sec / min_hp_ratio): 坚忍 (ba.berserk "根据已损失的生命值获得相应比例的属性
|
||||
// 加成") — ASPD and SP recovery × min(1, lost HP ÷ (1 − min_hp_ratio)) while he is deployed. SBL-X stage 3: +70 /
|
||||
// +2.3 / at 50 % lost (the module talent's bb).
|
||||
// - T2 守正自明 "攻击时有20%的概率获得1点技力,生命低于50%时概率变为70%" (bb prob_1 / prob_2 / hp_ratio / sp): zuole_t_2
|
||||
// rolls on every damage he outputs (ON_OUTPUT_DAMAGE — skill damage too), prob_2 below hp_ratio. SBL-Y stage 3
|
||||
// (zuole_e_003_talent, ON_CALCULATE_DAMAGE): "…且当次攻击的攻击力提升至120%…80%": a success also scales that damage
|
||||
// instance by atk_scale.
|
||||
// - Module SBL-X “岂苦夜长” (trait moduleDesc "生命值低于50%时,获得25%的庇护"; the hidden part merged into the first talent's
|
||||
// bb: hp_ratio / damage_resistance): 庇护 (ba.protect "受到的物理和法术伤害降低相应比例") while HP < hp_ratio
|
||||
// (zuole_e_002[resistance]: the 庇护 buff is created when HP drops below it and finished when it is back). PRTS S2 备注:
|
||||
// 行险 resets it, it comes back 0.1 s later "并因此导致庇护的BUFF顺序落后于本技能的屏障" — a 庇护 created after his
|
||||
// barrier cuts only what passes the barrier (the `hpDamage` hook), one created before it cuts the hit first.
|
||||
// - Module SBL-Y “秉烛人的记录” (trait bb hp_ratio): "被击倒时不撤退且回复30%生命(单次部署只触发1次)" — the first lethal
|
||||
// hit of a deployment is prevented and he heals hp_ratio × max HP (zuole_e_003_trait[heal] HealViaMaxHpRatio, 无视禁疗);
|
||||
// not while a 不死 already holds him ("_dontConsumeWhenUndeadable": 坚固维式重锤's window, items/battle.js holdsUndying).
|
||||
// - S1 破虏 (AUTO, 可充能 2 次): the next attack at atk_scale × ATK; "自身生命低于80%时额外攻击1次,低于50%时额外攻击2次"
|
||||
// (hp_ratio_double / hp_ratio_tripple): one / two more strikes on that target at the same scale, separate damage
|
||||
// instances [ASSUMED: the same target — nothing when it fell]. The data's DEFAULT trigger (an AUTO "next attack").
|
||||
// - S2 行险 (MANUAL, 12 s): "立即流失50%当前生命" (zuole_s_2[shield] DamageViaCurHpRatio, undeadable: never below 1 HP;
|
||||
// a 流失), then a barrier of scale × max HP (ba.barrier "可以吸收一定数值的伤害") added to the one he still has, capped at
|
||||
// max_scale × max HP at each gain (PRTS "上限于每次获取屏障时实时发生变化"; Terra: the cap counts this skill's barrier
|
||||
// only); ATK +atk, block +block_cnt, every blocked enemy struck at once. Once the skill is over the barrier loses
|
||||
// −shield_decrease every second (PRTS "技能结束时屏障以每秒-200点的速度流失"; zuole_s_2[shield_core] ON_BUFF_TRIGGER).
|
||||
// - S3 佑序有炎 (MANUAL, data SKILL_RANGE on its 3-2): 7 slashes ("立刻…": all in the cast instant [ASSUMED: the kits'
|
||||
// instant convention — his skeleton's 2 s Skill_3 clip spreads its 7 OnAttack events over 0.2 … 1.2 s, and the engine
|
||||
// models no animation lock]), each on at most 3 enemies of the skill range (the 3 is the text's: no
|
||||
// blackboard key; air units too [ASSUMED: no 对空 note — docs/SIM.md §8]) for atk_scale × ATK physical, the last
|
||||
// ×last_atk_bonus and 晕眩 `stun` s (zuole_s_3: AtkScaleUp once spell_times reaches times). Meanwhile the trait heals
|
||||
// nothing (zuole_trait "CheckContainsBuff zuole_s_3 → IfNot → heal") and every damage instance he outputs adds
|
||||
// value × shield_scale to a barrier (zuole_s_3 ON_OUTPUT_DAMAGE; PRTS "屏障获取不经过治疗流程,不受治疗倍率等影响"), capped
|
||||
// at max_scale × max HP at each gain, lasting shield_duration s from the latest gain (PRTS "每次获取屏障时重置剩余持续
|
||||
// 时间为15s").
|
||||
|
||||
import { num, talentBb, traitBb, up, onHitBy, onHitOn, giveSp, skillRec } from '../shared/tier1.js';
|
||||
import { absoluteRangeKeys, sortEnemyTargets } from '../../../targeting.js';
|
||||
import { isHpLoss } from '../../../damage.js';
|
||||
import { holdsUndying } from '../../items/battle.js';
|
||||
|
||||
const S1 = 'skchr_zuole_1';
|
||||
const S2 = 'skchr_zuole_2';
|
||||
const S3 = 'skchr_zuole_3';
|
||||
/** S3 "每次对最多3名敌人" — in the text only (no blackboard key). */
|
||||
const S3_TARGETS = 3;
|
||||
/** PRTS S2 备注 "庇护BUFF于技能开启0.1s后重新判定并生效". */
|
||||
const PROTECT_RESET = 0.1;
|
||||
/** zuole_s_2[shield_core] decays once per trigger: "每秒-200点" (PRTS S2 备注). */
|
||||
const S2_DECAY_EVERY = 1;
|
||||
const S2_BARRIER = 'skill:zuole:barrier2';
|
||||
const S3_BARRIER = 'skill:zuole:barrier3';
|
||||
const BERSERK = 'talent:zuole:berserk';
|
||||
|
||||
const bbOf = (chess, id) => skillRec(chess, id)?.bb ?? {};
|
||||
/** The barrier of his skill he holds (one skill per pick), or null. */
|
||||
const barrierOf = (u) => u.findBuff(S2_BARRIER) || u.findBuff(S3_BARRIER);
|
||||
|
||||
export default {
|
||||
char_4121_zuole: (bb, chess) => {
|
||||
const tb = traitBb(chess);
|
||||
const t0 = talentBb(chess, 0), t1 = talentBb(chess, 1);
|
||||
const b1 = bbOf(chess, S1), b2 = bbOf(chess, S2), b3 = bbOf(chess, S3);
|
||||
const s1 = skillRec(chess, S1), s3 = skillRec(chess, S3);
|
||||
const healValue = num(tb.value, 70);
|
||||
// SBL-X 庇护 (merged into the first talent's bb) — its state is shared with S2's reset
|
||||
const protectRatio = num(t0.hp_ratio), protectCut = t0.hp_ratio != null ? num(t0.damage_resistance) : 0;
|
||||
const P = { since: null, blockedUntil: -Infinity };
|
||||
const s2Decay = ({ battle, unit, buff }) => {
|
||||
const sk = unit.skill;
|
||||
if (sk && sk.active && sk.id === S2) return;
|
||||
buff.shield = Math.max(0, buff.shield + num(b2.shield_decrease, -200));
|
||||
unit.markDirty();
|
||||
if (!(buff.shield > 0)) battle.removeBuff(unit, buff);
|
||||
};
|
||||
const gainS3Barrier = (battle, unit) => {
|
||||
const cap = unit.s.maxHp * num(b3.max_scale, 2);
|
||||
const cur = unit.findBuff(S3_BARRIER);
|
||||
const val = Math.min(cap, (cur ? cur.shield : 0) + healValue * num(b3.shield_scale));
|
||||
if (!(val > 0)) return;
|
||||
battle.addBuff(unit, { key: S3_BARRIER, shield: val, duration: num(b3.shield_duration, 15), refresh: 'replace', visible: true,
|
||||
tags: ['skill'], data: { createdAt: cur?.data?.createdAt ?? battle.time } });
|
||||
};
|
||||
return {
|
||||
skills: {
|
||||
[S1]: {
|
||||
kind: num(s1?.maxChargeTime, 1) > 1 ? 'charges' : 'instant',
|
||||
attack: {
|
||||
atkScale: num(b1.atk_scale, 1),
|
||||
onHit({ battle, unit, target }) {
|
||||
const r = unit.hpRatio;
|
||||
const extra = (r < num(b1.hp_ratio_double, 0.8) ? 1 : 0) + (r < num(b1.hp_ratio_tripple, 0.5) ? 1 : 0);
|
||||
for (let i = 0; i < extra && target && target.alive; i++) {
|
||||
battle.dealDamage(unit, target, { amount: unit.s.atk * num(b1.atk_scale, 1), type: 'phys', isSkill: true, tags: ['skill'] });
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
[S2]: {
|
||||
kind: 'duration',
|
||||
mods: { atkPct: num(b2.atk), blockCnt: num(b2.block_cnt) },
|
||||
attack: { hitAllBlocked: true },
|
||||
onStart({ battle, unit }) {
|
||||
const loss = Math.min(unit.hp * num(b2.hp_ratio), unit.hp - 1);
|
||||
if (loss > 0) battle.loseHp(unit, loss, { source: unit });
|
||||
const cap = unit.s.maxHp * num(b2.max_scale, 2);
|
||||
const add = Math.min(cap, unit.s.maxHp * num(b2.scale));
|
||||
const cur = unit.findBuff(S2_BARRIER);
|
||||
if (cur) { cur.shield = Math.min(cap, cur.shield + add); unit.markDirty(); }
|
||||
else if (add > 0) {
|
||||
battle.addBuff(unit, { key: S2_BARRIER, shield: add, interval: S2_DECAY_EVERY, onTick: s2Decay, visible: true, tags: ['skill'],
|
||||
data: { createdAt: battle.time } });
|
||||
}
|
||||
battle.fx('shield', { x: unit.x, y: unit.y, id: unit.id });
|
||||
// SBL-X: 行险 resets the 庇护, which is judged again PROTECT_RESET s later (after the barrier)
|
||||
P.since = null;
|
||||
P.blockedUntil = battle.time + PROTECT_RESET;
|
||||
},
|
||||
},
|
||||
[S3]: {
|
||||
kind: 'instant',
|
||||
onStart({ battle, unit }) {
|
||||
const grid = s3?.rangeGrid?.length ? s3.rangeGrid : [[0, 0], [0, 1], [0, 2], [0, 3]];
|
||||
const keys = absoluteRangeKeys(grid, unit.tileR, unit.tileC, unit.dir, 0);
|
||||
const times = Math.max(1, Math.floor(num(b3.times, 7)));
|
||||
battle.fx('aoe', { x: unit.x + 1.5 * unit.fwd.x, y: unit.y + 1.5 * unit.fwd.y, radius: 1, id: unit.id, skill: 'zuole:slash' });
|
||||
unit.mem.zuoleS3 = true;
|
||||
try {
|
||||
for (let i = 1; i <= times && up(unit); i++) {
|
||||
const last = i === times;
|
||||
const foes = battle.enemiesInKeys(keys, unit, { canHitFly: true });
|
||||
sortEnemyTargets(battle, unit, foes, null);
|
||||
const amount = unit.s.atk * num(b3.atk_scale, 1) * (last ? num(b3.last_atk_bonus, 1) : 1);
|
||||
for (const e of foes.slice(0, S3_TARGETS)) {
|
||||
if (!e.alive) continue;
|
||||
battle.dealDamage(unit, e, { amount, type: 'phys', isSkill: true, tags: ['skill'] });
|
||||
if (last && e.alive) battle.applyStatus(e, 'stun', { duration: num(b3.stun), source: unit });
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
unit.mem.zuoleS3 = false;
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
talents: [
|
||||
{ install(battle, unit) { // 秉烛照影 (坚忍)
|
||||
const maxAs = num(t0.min_attack_speed), maxSp = num(t0.min_sp_recovery_per_sec), full = num(t0.min_hp_ratio, 0.3);
|
||||
if (!(maxAs > 0 || maxSp > 0) || !(full < 1)) return;
|
||||
let last = -1;
|
||||
const update = () => {
|
||||
if (!up(unit)) { last = -1; return; }
|
||||
const f = Math.max(0, Math.min(1, (1 - unit.hpRatio) / (1 - full)));
|
||||
if (Math.abs(f - last) < 1e-9) return;
|
||||
last = f;
|
||||
const cur = unit.findBuff(BERSERK);
|
||||
if (!(f > 0)) { if (cur) battle.removeBuff(unit, cur); return; }
|
||||
const mods = { aspd: maxAs * f, spRecoveryFlat: maxSp * f };
|
||||
if (cur) { cur.mods = mods; unit.markDirty(); } else battle.addBuff(unit, { key: BERSERK, mods, tags: ['talent'] });
|
||||
};
|
||||
battle.on('deploy', ({ unit: u }) => { if (u === unit) { last = -1; update(); } }, { owner: unit });
|
||||
battle.on('damaged', (c) => { if (c.target === unit) update(); }, { owner: unit });
|
||||
battle.on('tick', update, { owner: unit });
|
||||
} },
|
||||
{ install(battle, unit) { // 守正自明 (+ SBL-Y stage 3: ×atk_scale on a success)
|
||||
const p1 = num(t1.prob_1), p2 = num(t1.prob_2), thr = num(t1.hp_ratio, 0.5), sp = num(t1.sp), scale = num(t1.atk_scale, 1);
|
||||
if (!(sp > 0)) return;
|
||||
const roll = () => battle.rng.chance(unit.hpRatio < thr ? p2 : p1);
|
||||
if (scale !== 1) {
|
||||
onHitBy(battle, unit, ({ dmg }) => { if (dmg.type !== 'element' && roll()) { giveSp(unit, sp); dmg.amount *= scale; } });
|
||||
} else {
|
||||
battle.on('damaged', (c) => {
|
||||
if (c.source !== unit || !c.target || c.target.side !== 'enemy' || isHpLoss(c.dmg) || c.type === 'element') return;
|
||||
if (roll()) giveSp(unit, sp);
|
||||
}, { owner: unit });
|
||||
}
|
||||
} },
|
||||
],
|
||||
install(battle, unit) {
|
||||
unit.mem.zuoleProtect = P;
|
||||
// S3: the trait's heal turns into barrier while the slashes run (every damage instance he outputs)
|
||||
battle.on('heal', (c) => {
|
||||
if (unit.mem.zuoleS3 && c.source === unit && c.target === unit && c.opts && c.opts.self && !c.opts.tags) c.amount = 0;
|
||||
}, { owner: unit });
|
||||
battle.on('damaged', (c) => {
|
||||
if (!unit.mem.zuoleS3 || c.source !== unit || !c.target || c.target.side !== 'enemy' || isHpLoss(c.dmg) || c.type === 'element') return;
|
||||
gainS3Barrier(battle, unit);
|
||||
}, { owner: unit });
|
||||
// SBL-X 庇护: active while HP < protectRatio, judged again PROTECT_RESET s after 行险
|
||||
if (protectCut > 0) {
|
||||
const active = () => {
|
||||
const now = battle.time;
|
||||
if (!up(unit) || now < P.blockedUntil - 1e-9) { P.since = null; return false; }
|
||||
if (unit.hpRatio < protectRatio) { if (P.since == null) P.since = now; return true; }
|
||||
P.since = null;
|
||||
return false;
|
||||
};
|
||||
const afterBarrier = new WeakSet();
|
||||
battle.on('tick', active, { owner: unit });
|
||||
onHitOn(battle, unit, ({ dmg }) => {
|
||||
if ((dmg.type !== 'phys' && dmg.type !== 'arts') || !active()) return;
|
||||
const bar = barrierOf(unit);
|
||||
if (bar && bar.shield > 0 && (bar.data?.createdAt ?? Infinity) < P.since) afterBarrier.add(dmg);
|
||||
else dmg.mul *= 1 - protectCut;
|
||||
});
|
||||
battle.on('hpDamage', (c) => { if (c.target === unit && afterBarrier.has(c.dmg)) c.amount *= 1 - protectCut; }, { owner: unit });
|
||||
}
|
||||
// SBL-Y: 被击倒时不撤退且回复30%生命(单次部署只触发1次)
|
||||
const revive = num(tb.hp_ratio);
|
||||
if (revive > 0) {
|
||||
let usedSeq = -1;
|
||||
battle.on('fatal', (c) => {
|
||||
if (c.unit !== unit || c.prevented || usedSeq === unit.deploySeq || holdsUndying(battle, unit)) return;
|
||||
c.prevented = true;
|
||||
usedSeq = unit.deploySeq;
|
||||
battle.heal(unit, unit, unit.s.maxHp * revive, { self: true, ignoreHealFree: true, tags: ['trait'] });
|
||||
battle.fx('revive', { x: unit.x, y: unit.y, id: unit.id });
|
||||
}, { owner: unit, priority: -60 });
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -6,8 +6,9 @@
|
||||
// → × source dmgDealtMul (× phys/artsDealtMul) × target dmgTakenMul (not for 元素伤害) × type-taken mul × dmg.mul
|
||||
// → 限伤 (leaders in boss / hidden battles: a hit of ceil(final) ≥ BOSS_HIT_LIMIT is cancelled, see leaderHitCancelled)
|
||||
// → shields (hit-negating barriers first, then HP shields; a typed one — buff `shieldType` — only its damage type)
|
||||
// → HP loss (boss pool routing) → 'damaged' hook
|
||||
// → SP-on-hurt / TAKE_DAMAGE trigger → fatal/kill.
|
||||
// → 'hpDamage' hook (what passed the shields; handlers may only lower `amount`: the 伤判效果 that act after a
|
||||
// barrier — 煌's 紧急除颤 HP floor, 左乐's 庇护 re-applied after his 行险 barrier) → HP loss (boss pool routing)
|
||||
// → 'damaged' hook → SP-on-hurt / TAKE_DAMAGE trigger → fatal/kill.
|
||||
// Damage-dealt stats (the source's `stats.dmg`, the player's `damageDealt`) count only HP removed from the other side:
|
||||
// self and friendly damage (a 源石溶剂 drain, an operator's own 流失) is the target's `taken` and keeps the kill credit.
|
||||
// Phys: max(A − max(0, D×(1−defIgnorePct) − defIgnoreFlat), 5 %·A); Arts: max(A×(1 − R′/100), 5 %·A) with
|
||||
@@ -274,6 +275,12 @@ export function dealDamage(battle, source, target, dmgIn) {
|
||||
// ran before it (the attack, its SP, `hit` hook effects, separate element 损伤) stays; nothing after it happens
|
||||
if (final > 0 && leaderHitCancelled(battle, target, final)) return 0;
|
||||
final = absorbShields(battle, target, final, type);
|
||||
// 伤判效果 after the barriers (header): a handler may lower what reaches the HP — never raise it (a 流失 skips this)
|
||||
if (final > 0 && battle._hooks.hpDamage) {
|
||||
const hctx = { source: hs, target, amount: final, dmg, credit: source };
|
||||
battle.emit('hpDamage', hctx);
|
||||
if (Number.isFinite(hctx.amount)) final = Math.max(0, Math.min(final, hctx.amount));
|
||||
}
|
||||
return applyHpLoss(battle, source, target, final, dmg);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,13 @@ import { getDefaultSource, DataSource } from '../../server/sim/simdata.js';
|
||||
import { buildBattleSpec, createBattleFromSpec } from '../../server/sim/spec.js';
|
||||
import { unitInfo } from '../../server/sim/snapshot.js';
|
||||
import { isDiyDef, kitOf } from '../../server/sim/content/index.js';
|
||||
import { KITTED_CHARS } from '../../server/sim/content/kits/index.js';
|
||||
|
||||
const load = (f) => JSON.parse(readFileSync(new URL(`../../data/${f}.json`, import.meta.url), 'utf8'));
|
||||
const BACKUPS = load('backups');
|
||||
const SIEGE = 'char_112_siege';
|
||||
/** An owned 6★ without an operator kit yet (the generic kit's case) — the first of diy.ownedPool, null once all have one. */
|
||||
const KITLESS = BACKUPS.diy.ownedPool.find((id) => !KITTED_CHARS.includes(id)) ?? null;
|
||||
const T5 = 'chess_char_5_diy1_a', T6 = 'chess_char_6_diy1_a';
|
||||
const dummy = (key, o = {}) => enemyRec({ key, hp: 1e9, speed: 0, mass: 0, ...o });
|
||||
const ENEMIES = { enemy_dummy: dummy('enemy_dummy') };
|
||||
@@ -54,18 +57,21 @@ test('a battle fields 自选 pieces by their kit: an owned 6★\'s operator kit
|
||||
{ diy: { slot: 5, charId: SIEGE, skillIndex: 1 }, row: 10, col: 3 },
|
||||
{ diy: { slot: 'chess_char_5_diy2_a', charId: 'char_609_acguad' }, elite: true, row: 10, col: 5 },
|
||||
{ diy: { slot: T6, charId: 'char_617_sharp2' }, elite: true, row: 10, col: 7 },
|
||||
{ diy: { slot: 'chess_char_6_diy2_a', charId: 'char_017_huang', skillIndex: 2 }, row: 11, col: 3 },
|
||||
...(KITLESS ? [{ diy: { slot: 'chess_char_6_diy2_a', charId: KITLESS, skillIndex: 2 }, row: 11, col: 3 }] : []),
|
||||
{ diy: { slot: 'chess_char_6_diy2_a', charId: 'char_601_cguard' }, row: 11, col: 5 }, // illegal at tier 6: never fielded
|
||||
], { kits: { [SIEGE]: siegeKit, chess_char_5_diy1_a: () => { throw new Error('a 自选 piece never runs a kit of its slot id'); } } });
|
||||
h.step();
|
||||
const [siege, sharp, sharp2, huang] = [1, 2, 3, 4].map((uid) => h.unit(uid));
|
||||
assert.equal(h.unit(5), null, 'an illegal pick fields nothing');
|
||||
const [siege, sharp, sharp2, kitless] = [1, 2, 3, 4].map((uid) => h.unit(uid));
|
||||
assert.equal(h.unit(KITLESS ? 5 : 4), null, 'an illegal pick fields nothing');
|
||||
assert.deepEqual([siege.defId, siege.def.charId, siege.skill.id, siege.kit.diyProbe, siege.kit.skillSource], [T5, SIEGE, 'skchr_siege_2', true, 'skills']);
|
||||
assert.equal(kitOf(siege.def, { [T5]: 'slot', chess_char_5_diy1: 'bare', [SIEGE]: 'mine' }), 'mine', 'kitOf: by charId only');
|
||||
assert.equal(kitOf(siege.def, { [T5]: 'slot' }), undefined);
|
||||
assert.deepEqual([sharp.defId, sharp.def.charId, sharp.skill.id, !!sharp.kit.generic, sharp.kit.skillSource, sharp.def.raw.module.level], ['chess_char_5_diy2_b', 'char_609_acguad', 'skchr_acguad_3', false, 'skills', 1]);
|
||||
assert.deepEqual([sharp2.skill.id, !!sharp2.kit.generic, sharp2.def.raw.module.level, sharp2.def.raw.module.active], ['skchr_sharp2_1', false, 3, true], '领主·Sharp at tier 6: S1 + LOR-X stage 3');
|
||||
assert.deepEqual([huang.def.charId, huang.skill.id, !!huang.kit.generic, huang.def.bonds], ['char_017_huang', 'skchr_huang_3', true, ['yanShip', 'victoriaShip']], '煌 has no kit yet: the generic kit');
|
||||
if (KITLESS) {
|
||||
assert.deepEqual([kitless.def.charId, kitless.skill.id, !!kitless.kit.generic, kitless.def.bonds],
|
||||
[KITLESS, BACKUPS.units[KITLESS].forms['2/1/4/0'].skills[2].skillId, true, BACKUPS.diy.operators[KITLESS].bonds], `${KITLESS} has no kit yet: the generic kit`);
|
||||
}
|
||||
// the elite reserve uses the generic kit with its exact stat talents (as a 补位 stand-in does)
|
||||
const h2 = battle([{ diy: { slot: 5, charId: 'char_601_cguard' }, elite: true, row: 10, col: 3 }]);
|
||||
h2.step();
|
||||
|
||||
@@ -0,0 +1,327 @@
|
||||
// test/content/op_chyue.test.js — the 自选 operator kit of 重岳 (char_2024_chyue, 6★ 斗士; kit
|
||||
// server/sim/content/kits/ops/op-chyue.js), fielded the production way (a DIY slot + its `diy` pick, simdata getDiy) in
|
||||
// every form: tiers 5 / 6, normal (E2 Lv1, skill rank 4, no module) and elite (E2 Lv60, rank 7) with no module, FGT-X
|
||||
// “自晦及明” or FGT-Y “朔” at stage 1 (tier 5) / 3 (tier 6). Every number is read back from data/backups.json (the form of
|
||||
// that slot status); the fidelity checklist of kits/README.md item by item.
|
||||
// Run: node --test test/content/op_chyue.test.js
|
||||
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { makeBattle, enemyRec, checkInvariants } from '../helpers/battleHarness.js';
|
||||
import { KITTED_CHARS, OPERATOR_KITS, KITS } from '../../server/sim/content/kits/index.js';
|
||||
import { diyPool, validateDiyPicks } from '../../shared/diy.js';
|
||||
|
||||
const load = (f) => JSON.parse(readFileSync(new URL(`../../data/${f}.json`, import.meta.url), 'utf8'));
|
||||
const CHESS = load('chess');
|
||||
const BACKUPS = load('backups');
|
||||
const CHYUE = 'char_2024_chyue';
|
||||
const FORMS = BACKUPS.units[CHYUE].forms;
|
||||
const SLOT = { 5: 'chess_char_5_diy1_a', 6: 'chess_char_6_diy1_a' };
|
||||
const FGTX = 'uniequip_002_chyue', FGTY = 'uniequip_003_chyue';
|
||||
const S1 = 'skchr_chyue_1', S2 = 'skchr_chyue_2', S3 = 'skchr_chyue_3';
|
||||
const X6 = [[2, 0], [1, 0], [0, -2], [0, -1], [0, 0], [0, 1], [0, 2], [-1, 0], [-2, 0]];
|
||||
const formOf = (tier, elite) => FORMS[elite ? (tier === 5 ? '2/60/7/1' : '2/60/7/3') : '2/1/4/0'];
|
||||
const skillOf = (tier, elite, id) => formOf(tier, elite).skills.find((s) => s.skillId === id);
|
||||
const modOf = (tier, mod) => (mod ? formOf(tier, true).modules.find((m) => m.uniEquipId === mod) : null);
|
||||
const approx = (a, b, msg, eps = 1e-6) => assert.ok(Math.abs(a - b) <= eps * Math.max(1, Math.abs(b)), `${msg}: ${a} vs ${b}`);
|
||||
const dummy = (key, o = {}) => enemyRec({ key, hp: 1e9, speed: 0, mass: 0, ...o });
|
||||
const ENEMIES = {
|
||||
enemy_dummy: dummy('enemy_dummy'), enemy_fly: dummy('enemy_fly', { motion: 'FLY' }),
|
||||
enemy_frail: dummy('enemy_frail', { hp: 100 }), enemy_mid: dummy('enemy_mid', { hp: 3000 }),
|
||||
enemy_walk: enemyRec({ key: 'enemy_walk', hp: 1e9, speed: 0.6, mass: 0 }),
|
||||
};
|
||||
/** Every 自选 form: [tier, elite, module]. */
|
||||
const FORMS_ALL = [[5, false, null], [6, false, null], ...[5, 6].flatMap((t) => [null, FGTX, FGTY].map((m) => [t, true, m]))];
|
||||
const label = ([tier, elite, mod]) => `T${tier} ${elite ? 'elite' : 'normal'} ${mod ?? 'none'}`;
|
||||
const markOf = (u, e) => e.findBuff(`talent:chyue:mark#${u.id}`);
|
||||
|
||||
/** A battle with 重岳 as uid 1 at (row, col) facing RIGHT, plus `others`. */
|
||||
function field({ tier = 5, elite = false, mod = null, skill = 2, row = 10, col = 5, others = [], seed = 5 } = {}) {
|
||||
const h = makeBattle({
|
||||
defs: { enemies: ENEMIES }, timeLimit: 900, autoFinish: false, seed,
|
||||
flags: { dpPerSec: 0, dpMax: 999 }, hooks: ['damaged', 'skillStart', 'skillEnd', 'statusApplied'], captureNoisy: true,
|
||||
units: [{ uid: 1, diy: { slot: SLOT[tier], charId: CHYUE, skillIndex: skill, uniEquipId: mod }, elite, row, col }, ...others],
|
||||
});
|
||||
h.step();
|
||||
return { h, u: h.unit(1) };
|
||||
}
|
||||
const hitsBy = (h, u) => h.hooksOf('damaged').filter((c) => c.source === u && c.target?.side === 'enemy');
|
||||
function done(h) {
|
||||
checkInvariants(h.b);
|
||||
assert.equal(h.b.errors.length, 0, JSON.stringify(h.b.errors[0]));
|
||||
}
|
||||
|
||||
test('重岳 in every 自选 form: his operator kit (all three skills authored), the form\'s stats + module attributes, 1-1 range, blocks 1, melee ground-only, 炎, no 特质; FGT-X 15 % physical dodge, FGT-Y +10 ASPD above 50 % HP', () => {
|
||||
assert.equal(OPERATOR_KITS[CHYUE], KITS[CHYUE]);
|
||||
for (const f of FORMS_ALL) {
|
||||
const [tier, elite, mod] = f;
|
||||
for (const skill of [0, 1, 2]) {
|
||||
const { h, u } = field({ tier, elite, mod, skill });
|
||||
const form = formOf(tier, elite), m = elite ? modOf(tier, mod) : null;
|
||||
assert.deepEqual([u.def.charId, u.def.diyFor, u.skill.id, !!u.kit.generic, u.kit.skillSource], [CHYUE, SLOT[tier], form.skills[skill].skillId, false, 'skills'], label(f));
|
||||
assert.deepEqual([u.base.maxHp, u.base.atk, u.base.def], [form.stats.maxHp + (m?.attr.maxHp ?? 0), form.stats.atk + (m?.attr.atk ?? 0), form.stats.def + (m?.attr.def ?? 0)], `${label(f)}: stats`);
|
||||
assert.deepEqual([u.s.blockCnt, u.profile.attack, u.profile.canHitFly, u.profile.dmgType, u.base.bat], [1, 'melee', false, 'phys', 0.78], `${label(f)}: 斗士`);
|
||||
assert.deepEqual(u.liveRangeGrid, form.rangeGrid, `${label(f)}: 1-1`);
|
||||
assert.deepEqual([u.def.bonds, u.def.raw.garrisonIds], [['yanShip'], []], `${label(f)}: bonds / 特质`);
|
||||
assert.ok(!u.s.flags.liftoff && !u.s.flags.camou && !u.s.flags.stealth && !u.s.flags.untargetable, `${label(f)}: ground enemies target him`);
|
||||
assert.equal(u.s.dodgePhys, elite && mod === FGTX ? 0.15 : 0, `${label(f)}: FGT-X 物理闪避`);
|
||||
assert.equal(u.s.aspd, elite && mod === FGTY ? 110 : 100, `${label(f)}: FGT-Y at full HP`);
|
||||
if (elite && mod === FGTY) {
|
||||
u.hp = u.s.maxHp * 0.5;
|
||||
h.step();
|
||||
assert.equal(u.s.aspd, 100, `${label(f)}: FGT-Y off at 50 % (not above)`);
|
||||
}
|
||||
done(h);
|
||||
}
|
||||
}
|
||||
// the numbers of the forms (zh_CN): E2 Lv1 2160 / 477 / 304, E2 Lv60 2475 / 552 / 343; FGT-X +210 / +25 / +20 →
|
||||
// +260 / +45 / +30, FGT-Y +52 / +25 → +75 / +35 ATK / DEF
|
||||
assert.deepEqual([FORMS['2/1/4/0'].stats.maxHp, FORMS['2/1/4/0'].stats.atk, FORMS['2/60/7/1'].stats.maxHp, FORMS['2/60/7/1'].stats.atk], [2160, 477, 2475, 552]);
|
||||
assert.deepEqual([modOf(5, FGTX).attr, modOf(6, FGTX).attr, modOf(5, FGTY).attr, modOf(6, FGTY).attr],
|
||||
[{ maxHp: 210, atk: 25, def: 20 }, { maxHp: 260, atk: 45, def: 30 }, { atk: 52, def: 25 }, { atk: 75, def: 35 }]);
|
||||
assert.deepEqual([modOf(5, FGTX).traitOverride.bb, modOf(6, FGTY).traitOverride.bb], [{ prob: 0.15 }, { attack_speed: 10, hp_ratio: 0.5 }]);
|
||||
});
|
||||
|
||||
test('a 自选 pick: 重岳 is offered at tiers 5 and 6 (he has a kit) and a roster with him passes validateDiyPicks', () => {
|
||||
const data = { chess: CHESS, backups: BACKUPS };
|
||||
assert.ok(KITTED_CHARS.includes(CHYUE));
|
||||
for (const t of [5, 6]) assert.ok(diyPool(t, { data, kitted: KITTED_CHARS }).includes(CHYUE), `tier ${t}`);
|
||||
assert.deepEqual(validateDiyPicks({ [SLOT[6]]: { charId: CHYUE, skillIndex: 0, uniEquipId: FGTX } }, { data, kitted: KITTED_CHARS }),
|
||||
{ ok: true, picks: { [SLOT[6]]: { charId: CHYUE, skillIndex: 0, uniEquipId: FGTX } } });
|
||||
});
|
||||
|
||||
test('S1 冲盈 (MANUAL, attack SP 5 / 4, 3 charges, data DEFAULT): 250 % / 290 % ATK on the attack target; from a full stack (蓄力) every charge goes and it strikes 3 times', () => {
|
||||
for (const [tier, elite] of [[5, false], [6, true]]) {
|
||||
const sk = skillOf(tier, elite, S1);
|
||||
const { h, u } = field({ tier, elite, skill: 0 });
|
||||
assert.deepEqual([u.skill.rule, u.skill.spType, u.skill.spCost, u.skill.maxCharges, sk.initSp, sk.bb.atk_scale, sk.bb.times],
|
||||
['DEFAULT', 'attack', elite ? 4 : 5, 3, 0, elite ? 2.9 : 2.5, 3], `T${tier}`);
|
||||
// a full stack: 蓄力
|
||||
u.skill.gainSp(999);
|
||||
assert.equal(u.skill.charges, 3);
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
const fly = h.spawn('enemy_fly', { pos: [10, 6] });
|
||||
assert.ok(h.runUntil(() => u.skill.activations === 1, 3), `T${tier}: cast`);
|
||||
h.step();
|
||||
const strike = hitsBy(h, u).filter((c) => c.dmg.isSkill);
|
||||
assert.equal(strike.length, 3, `T${tier}: three strikes`);
|
||||
for (const c of strike) {
|
||||
assert.equal(c.target, e, `T${tier}: the ground target`);
|
||||
approx(c.dmg.amount, u.s.atk * sk.bb.atk_scale, `T${tier}: ${sk.bb.atk_scale * 100} %`);
|
||||
assert.ok(c.dmg.mul === 1 || Math.abs(c.dmg.mul - 1.65) < 1e-9, `T${tier}: ×1 or ×1.65 (止戈)`);
|
||||
approx(c.amount, c.dmg.amount * c.dmg.mul, `T${tier}: physical, DEF 0`);
|
||||
}
|
||||
assert.deepEqual([u.skill.charges, u.skill.sp], [0, 0], `T${tier}: every charge spent`);
|
||||
assert.ok(!hitsBy(h, u).some((c) => c.target === fly), `T${tier}: never the flyer`);
|
||||
// one charge: one strike
|
||||
u.skill.gainSp(u.skill.spCost);
|
||||
assert.equal(u.skill.charges, 1);
|
||||
const n0 = hitsBy(h, u).filter((c) => c.dmg.isSkill).length;
|
||||
assert.ok(h.runUntil(() => u.skill.activations === 2, 4), `T${tier}: second cast`);
|
||||
h.step();
|
||||
assert.equal(hitsBy(h, u).filter((c) => c.dmg.isSkill).length - n0, 1, `T${tier}: one strike`);
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('S1 冲盈: exact damage — 290 % ATK per strike, ×1.65 on a 止戈-marked target; the strike rolls no 止戈 and gives no attack SP', () => {
|
||||
const { h, u } = field({ tier: 6, elite: true, skill: 0 });
|
||||
const sk = skillOf(6, true, S1);
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
u.skill.gainSp(u.skill.spCost);
|
||||
assert.ok(h.runUntil(() => u.skill.activations === 1, 3));
|
||||
h.step();
|
||||
const c = hitsBy(h, u).find((x) => x.dmg.isSkill);
|
||||
approx(c.amount, u.s.atk * sk.bb.atk_scale, '290 % (no mark yet)');
|
||||
assert.equal(markOf(u, e), null, 'the skill strike marks nothing');
|
||||
assert.equal(u.skill.sp, 0, 'no attack SP for the strike');
|
||||
h.b.addBuff(e, { key: `talent:chyue:mark#${u.id}`, duration: 2.5 });
|
||||
u.skill.gainSp(u.skill.spCost);
|
||||
assert.ok(h.runUntil(() => u.skill.activations === 2, 4));
|
||||
h.step();
|
||||
const c2 = hitsBy(h, u).filter((x) => x.dmg.isSkill)[1];
|
||||
approx(c2.amount, u.s.atk * sk.bb.atk_scale * 1.65, '×1.65 on the marked target');
|
||||
done(h);
|
||||
});
|
||||
|
||||
test('S2 拂尘 (MANUAL, 2 charges, data SKILL_RANGE x-4): ≤ 4 enemies around (air too; his marked ones first, then the one he blocks) take 290 % / 350 %; the marked ground ones 浮空 2 s; 0.5 s later every 浮空 enemy around loses it, takes 410 % / 480 % and is marked', () => {
|
||||
for (const [tier, elite] of [[5, false], [6, true]]) {
|
||||
const sk = skillOf(tier, elite, S2);
|
||||
const { h, u } = field({ tier, elite, skill: 1, row: 9 });
|
||||
assert.deepEqual([u.skill.rule, u.skill.spType, u.skill.spCost, u.skill.maxCharges, sk.initSp, sk.rangeId, sk.bb.max_target, sk.bb.atk_scale, sk.bb.atk_scale_down],
|
||||
['SKILL_RANGE', 'time', elite ? 11 : 12, 2, elite ? 7 : 6, 'x-4', 4, elite ? 3.5 : 2.9, elite ? 4.8 : 4.1], `T${tier}`);
|
||||
const blocked = h.spawn('enemy_dummy', { pos: [9, 5] });
|
||||
const m1 = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
const m2 = h.spawn('enemy_dummy', { pos: [10, 4] });
|
||||
const flyM = h.spawn('enemy_fly', { pos: [8, 6] });
|
||||
const plain1 = h.spawn('enemy_dummy', { pos: [8, 4] });
|
||||
const plain2 = h.spawn('enemy_dummy', { pos: [9, 6] });
|
||||
const outside = h.spawn('enemy_dummy', { pos: [9, 7] });
|
||||
const lifted = h.spawn('enemy_dummy', { pos: [10, 5] }); // 浮空 by another source, not marked
|
||||
h.step();
|
||||
assert.equal(blocked.blockedBy, u);
|
||||
for (const e of [m1, m2, flyM]) h.b.addBuff(e, { key: `talent:chyue:mark#${u.id}`, duration: 9 });
|
||||
h.b.applyStatus(lifted, 'levitate', { duration: 5, source: null });
|
||||
assert.ok(lifted.isFlying);
|
||||
u.skill.gainSp(sk.spCost);
|
||||
assert.ok(h.runUntil(() => u.skill.activations === 1, 2), `T${tier}: cast`);
|
||||
const t0 = h.b.time;
|
||||
const first = hitsBy(h, u).filter((c) => c.dmg.isSkill);
|
||||
const hitSet = new Set(first.map((c) => c.target));
|
||||
assert.equal(first.length, 4, `T${tier}: four targets`);
|
||||
assert.deepEqual([m1, m2, flyM, blocked].map((e) => hitSet.has(e)), [true, true, true, true], `T${tier}: the marked (flyer included), then the blocked one`);
|
||||
assert.ok(![plain1, plain2, outside].some((e) => hitSet.has(e)), `T${tier}: no room for the rest`);
|
||||
for (const c of first) approx(c.amount, u.s.atk * sk.bb.atk_scale * (markOf(u, c.target) ? 1.65 : 1), `T${tier}: ${sk.bb.atk_scale * 100} %`);
|
||||
assert.deepEqual([m1, m2, flyM, blocked].map((e) => !!e.s.flags.levitate), [true, true, false, false], `T${tier}: the marked ground ones 浮空 (not a flyer, not the unmarked)`);
|
||||
approx(m1.findBuff('levitate').timeLeft, 2, `T${tier}: 2 s`, 0.05);
|
||||
assert.equal(blocked.blockedBy, u, 'still blocked');
|
||||
h.run(0.4);
|
||||
assert.equal(hitsBy(h, u).filter((c) => c.dmg.isSkill).length, 4, `T${tier}: nothing yet`);
|
||||
h.runUntil(() => h.b.time >= t0 + 0.5 - 1e-9, 0.3);
|
||||
h.step();
|
||||
const second = hitsBy(h, u).filter((c) => c.dmg.isSkill).slice(4);
|
||||
assert.deepEqual(new Set(second.map((c) => c.target)), new Set([m1, m2, lifted]), `T${tier}: every 浮空 enemy around (the other source's too)`);
|
||||
for (const c of second) approx(c.amount, u.s.atk * sk.bb.atk_scale_down * (c.target === lifted ? 1 : 1.65), `T${tier}: ${sk.bb.atk_scale_down * 100} % (its own mark comes after the damage)`);
|
||||
for (const e of [m1, m2, lifted]) {
|
||||
assert.ok(!e.s.flags.levitate, `T${tier}: 浮空 over`);
|
||||
approx(markOf(u, e).timeLeft, 2.5, `T${tier}: marked 2.5 s`, 0.1);
|
||||
}
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('S3 我无 (MANUAL, attack SP 11 / 10, data DEFAULT): its strike hits the target and the ground enemies within 0.8 for 240 % / 300 %; the 5th cast turns him — x-6, double normal hits, +1 SP per attack (阻回 ignored), a self-cast the moment SP is full, the strike lands twice; a redeploy undoes it', () => {
|
||||
for (const [tier, elite] of [[5, false], [6, true]]) {
|
||||
const sk = skillOf(tier, elite, S3);
|
||||
const { h, u } = field({ tier, elite, skill: 2, seed: 9 });
|
||||
assert.deepEqual([u.skill.rule, u.skill.spType, u.skill.spCost, sk.initSp, sk.bb.atk_scale, sk.bb.cast_cnt], ['DEFAULT', 'attack', elite ? 10 : 11, 0, elite ? 3 : 2.4, 5], `T${tier}`);
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
const near = h.spawn('enemy_dummy', { pos: [10.6, 6.4] });
|
||||
const fly = h.spawn('enemy_fly', { pos: [10, 6] });
|
||||
const far = h.spawn('enemy_dummy', { pos: [11, 7] });
|
||||
const strikes = () => hitsBy(h, u).filter((c) => c.dmg.isSkill);
|
||||
for (let n = 1; n <= 5; n++) {
|
||||
u.skill.gainSp(999);
|
||||
assert.ok(h.runUntil(() => u.skill.activations === n, 5), `T${tier}: cast ${n} (3 s apart: the automatic-operation cooldown)`);
|
||||
h.step();
|
||||
assert.equal(u.mem.chyueAwake, n === 5, `T${tier}: transformed after the 5th cast only`);
|
||||
}
|
||||
const pre = strikes();
|
||||
assert.equal(pre.length, 10, `T${tier}: each of the five strikes hits the target and the one within 0.8`);
|
||||
assert.deepEqual(new Set(pre.map((c) => c.target)), new Set([e, near]), `T${tier}: not the flyer, not the one 1.4 away`);
|
||||
for (const c of pre) {
|
||||
approx(c.dmg.amount, u.s.atk * sk.bb.atk_scale, `T${tier}: ${sk.bb.atk_scale * 100} %`);
|
||||
approx(c.amount, c.dmg.amount * c.dmg.mul, `T${tier}: physical (×1.65 on a marked one)`);
|
||||
}
|
||||
assert.deepEqual(u.liveRangeGrid, X6, `T${tier}: x-6`);
|
||||
assert.ok(!hitsBy(h, u).some((c) => c.target === fly || c.target === far), `T${tier}: never the flyer / far one before`);
|
||||
// transformed: two hits per normal attack, 2 SP per attack (阻回 does not stop the extra one)
|
||||
const n0 = hitsBy(h, u).length;
|
||||
h.b.addBuff(u, { key: 'test:noSp', flags: { noSp: true }, duration: 30 });
|
||||
const sp0 = u.skill.sp;
|
||||
h.runUntil(() => hitsBy(h, u).length > n0, 3);
|
||||
h.step();
|
||||
const plain = hitsBy(h, u).slice(n0).filter((c) => !c.dmg.isSkill);
|
||||
assert.ok(plain.length >= 1 && plain.length % 2 === 0, `T${tier}: double hits`);
|
||||
assert.equal(new Set(plain.map((c) => c.dmg.attackId)).size, plain.length / 2, `T${tier}: two per attack`);
|
||||
approx(u.skill.sp - sp0, plain.length / 2, `T${tier}: +1 SP per attack under 阻回`);
|
||||
h.b.removeBuff(u, 'test:noSp');
|
||||
// the self-cast: it fires the moment its SP is full (no 3 s operation cooldown), the strike twice
|
||||
const c6 = u.skill.activations;
|
||||
const s0 = strikes().length;
|
||||
u.skill.gainSp(999);
|
||||
h.step();
|
||||
assert.equal(u.skill.activations, c6 + 1, `T${tier}: cast at once`);
|
||||
const twice = strikes().slice(s0);
|
||||
assert.equal(twice.filter((c) => c.target === e).length, 2, `T${tier}: the strike lands twice on its target`);
|
||||
assert.equal(twice.filter((c) => c.target === near).length, 2, `T${tier}: and twice around it`);
|
||||
assert.ok(far.alive && !twice.some((c) => c.target === far || c.target === fly));
|
||||
// a redeploy starts untransformed
|
||||
h.b.kill(u, e);
|
||||
h.b.redeploy(u);
|
||||
h.step();
|
||||
assert.deepEqual([u.mem.chyueAwake, u.mem.chyueCasts], [false, 0], `T${tier}: reset`);
|
||||
assert.deepEqual(u.liveRangeGrid, formOf(tier, elite).rangeGrid, `T${tier}: 1-1 again`);
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('T1 止戈: each normal-attack damage instance rolls 23 % to mark its target for 2.5 s (not that instance), every damage of his to a marked target ×1.65 — FGT-Y stage 3 ×1.75 (stage 1 ×1.65)', () => {
|
||||
for (const f of [[5, false, null], [5, true, FGTY], [6, true, FGTY]]) {
|
||||
const [tier, elite, mod] = f;
|
||||
const { h, u } = field({ tier, elite, mod, skill: 0, seed: 21 });
|
||||
const t0 = u.def.raw.talents.find((t) => t.index === 0).bb;
|
||||
const scale = tier === 6 && mod === FGTY ? 1.75 : 1.65;
|
||||
assert.deepEqual([t0.prob, t0.damage_scale, t0.up_duration], [0.23, scale, 2.5], label(f));
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
let marked = 0, plainHits = 0, prevMarked = false;
|
||||
h.b.on('hit', (c) => { if (c.source === u && c.target === e && c.dmg.isAttack && !c.dmg.isSkill) prevMarked = !!markOf(u, e); }, { priority: 100 });
|
||||
const amounts = [];
|
||||
h.b.on('damaged', (c) => {
|
||||
if (c.source !== u || c.target !== e || c.dmg.isSkill) return;
|
||||
plainHits++;
|
||||
amounts.push([c.amount, prevMarked]);
|
||||
if (!prevMarked && markOf(u, e)) marked++;
|
||||
});
|
||||
h.b.addBuff(u, { key: 'test:noSp', flags: { noSp: true }, duration: Infinity }); // keep S1 off: plain attacks only
|
||||
h.run(400);
|
||||
const unmarkedHits = amounts.filter(([, m]) => !m).length;
|
||||
const rate = marked / unmarkedHits;
|
||||
assert.ok(rate > 0.18 && rate < 0.28, `${label(f)}: ${marked} / ${unmarkedHits} ≈ 23 %`);
|
||||
for (const [amt, m] of amounts.slice(0, 50)) approx(amt, u.s.atk * (m ? scale : 1), `${label(f)}: ×${scale} while marked`);
|
||||
assert.ok(plainHits > 400);
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('T2 万象为宾: a skill kill gives 3 SP when the skill ends (阻回 ignored; FGT-X stage 3: 4, and 1 when it killed nobody — stage 1: 3 / 0); a normal-attack kill gives nothing; S2\'s second segment is judged on its own', () => {
|
||||
for (const f of [[5, true, null], [5, true, FGTX], [6, true, FGTX]]) {
|
||||
const [tier, elite, mod] = f;
|
||||
const x3 = tier === 6 && mod === FGTX;
|
||||
const { h, u } = field({ tier, elite, mod, skill: 1, row: 9 });
|
||||
const t1 = u.def.raw.talents.find((t) => t.index === 1).bb;
|
||||
assert.equal(t1.sp, x3 ? 4 : 3, label(f));
|
||||
const s2 = skillOf(tier, elite, S2);
|
||||
// a cast that kills: +sp at its end; the second segment (no 浮空 enemy) gives the unkill part alone
|
||||
h.b.addBuff(u, { key: 'test:noSp', flags: { noSp: true }, duration: Infinity });
|
||||
const frail = h.spawn('enemy_frail', { pos: [10, 6] });
|
||||
u.skill.sp = 0;
|
||||
u.skill.addCharge(1);
|
||||
const sp0 = u.skill.sp;
|
||||
assert.ok(h.runUntil(() => u.skill.activations === 1, 2), label(f));
|
||||
assert.ok(!frail.alive, `${label(f)}: killed by the skill`);
|
||||
approx(u.skill.sp - sp0, x3 ? 4 : 3, `${label(f)}: +${x3 ? 4 : 3} under 阻回`);
|
||||
h.run(1.05);
|
||||
approx(u.skill.sp - sp0, (x3 ? 4 : 3) + (x3 ? 1 : 0), `${label(f)}: the second segment killed nobody: +${x3 ? 1 : 0}`);
|
||||
// a cast that kills nobody
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
const sp1 = u.skill.sp;
|
||||
u.skill.addCharge(1);
|
||||
h.run(3.5);
|
||||
assert.equal(u.skill.activations, 2, label(f));
|
||||
approx(u.skill.sp - sp1, x3 ? 2 : 0, `${label(f)}: no kill: ${x3 ? '1 + 1' : 'nothing'}`);
|
||||
assert.ok(e.alive);
|
||||
assert.ok(s2.spCost > 0);
|
||||
done(h);
|
||||
}
|
||||
// a normal-attack kill gives nothing; S2's second segment killing gives its own SP
|
||||
const { h, u } = field({ tier: 6, elite: true, mod: FGTX, skill: 1, row: 9 });
|
||||
h.b.addBuff(u, { key: 'test:noSp', flags: { noSp: true }, duration: Infinity });
|
||||
u.skill.sp = 0;
|
||||
const weak = h.spawn('enemy_frail', { pos: [9, 6] });
|
||||
h.runUntil(() => !weak.alive, 3);
|
||||
assert.equal(u.skill.sp, 0, 'a normal-attack kill: nothing (and 阻回 blocks the attack SP: time SP anyway)');
|
||||
const tough = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
const late = h.spawn('enemy_mid', { pos: [10, 5] }); // survives segment 1 (350 %), not segment 2 (+480 %)
|
||||
h.b.applyStatus(late, 'levitate', { duration: 5, source: null });
|
||||
h.b.addBuff(tough, { key: `talent:chyue:mark#${u.id}`, duration: 9 });
|
||||
u.skill.addCharge(1);
|
||||
const sp0 = u.skill.sp;
|
||||
assert.ok(h.runUntil(() => u.skill.activations === 1, 2));
|
||||
approx(u.skill.sp - sp0, 1, 'segment 1 killed nobody: +1');
|
||||
h.run(1.05);
|
||||
assert.ok(!late.alive, 'the second segment killed the 浮空 one');
|
||||
approx(u.skill.sp - sp0, 1 + 4, 'segment 2 killed: +4');
|
||||
done(h);
|
||||
});
|
||||
@@ -0,0 +1,358 @@
|
||||
// test/content/op_huang.test.js — the 自选 operator kit of 煌 (char_017_huang, 6★ 强攻手; kit
|
||||
// server/sim/content/kits/ops/op-huang.js), fielded the production way (a DIY slot + its `diy` pick, simdata getDiy) in
|
||||
// every form: tiers 5 / 6, normal (E2 Lv1, skill rank 4, no module) and elite (E2 Lv60, rank 7) with no module, CEN-X
|
||||
// “过载的武器与过热的心脏” or CEN-Y “稍后回来” at stage 1 (tier 5) / 3 (tier 6). Every number is read back from
|
||||
// data/backups.json (the form of that slot status); the fidelity checklist of kits/README.md item by item.
|
||||
// Run: node --test test/content/op_huang.test.js
|
||||
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { makeBattle, enemyRec, checkInvariants } from '../helpers/battleHarness.js';
|
||||
import { KITTED_CHARS, OPERATOR_KITS, KITS } from '../../server/sim/content/kits/index.js';
|
||||
import { diyPool, validateDiyPicks } from '../../shared/diy.js';
|
||||
|
||||
const load = (f) => JSON.parse(readFileSync(new URL(`../../data/${f}.json`, import.meta.url), 'utf8'));
|
||||
const CHESS = load('chess');
|
||||
const BACKUPS = load('backups');
|
||||
const HUANG = 'char_017_huang';
|
||||
const FORMS = BACKUPS.units[HUANG].forms;
|
||||
const SLOT = { 5: 'chess_char_5_diy1_a', 6: 'chess_char_6_diy1_a' };
|
||||
const CENX = 'uniequip_002_huang', CENY = 'uniequip_003_huang';
|
||||
const S1 = 'skchr_huang_1', S2 = 'skchr_huang_2', S3 = 'skchr_huang_3';
|
||||
const formOf = (tier, elite) => FORMS[elite ? (tier === 5 ? '2/60/7/1' : '2/60/7/3') : '2/1/4/0'];
|
||||
const skillOf = (tier, elite, id) => formOf(tier, elite).skills.find((s) => s.skillId === id);
|
||||
const modOf = (tier, mod) => (mod ? formOf(tier, true).modules.find((m) => m.uniEquipId === mod) : null);
|
||||
const approx = (a, b, msg, eps = 1e-6) => assert.ok(Math.abs(a - b) <= eps * Math.max(1, Math.abs(b)), `${msg}: ${a} vs ${b}`);
|
||||
const dummy = (key, o = {}) => enemyRec({ key, hp: 1e9, speed: 0, mass: 0, ...o });
|
||||
const ENEMIES = {
|
||||
enemy_dummy: dummy('enemy_dummy'), enemy_fly: dummy('enemy_fly', { motion: 'FLY' }),
|
||||
enemy_hitter: dummy('enemy_hitter', { atk: 400, bat: 1 }),
|
||||
enemy_walk: enemyRec({ key: 'enemy_walk', hp: 1e9, speed: 0.6, mass: 0 }),
|
||||
};
|
||||
/** Every 自选 form: [tier, elite, module]. */
|
||||
const FORMS_ALL = [[5, false, null], [6, false, null], ...[5, 6].flatMap((t) => [null, CENX, CENY].map((m) => [t, true, m]))];
|
||||
const label = ([tier, elite, mod]) => `T${tier} ${elite ? 'elite' : 'normal'} ${mod ?? 'none'}`;
|
||||
|
||||
/** A battle with 煌 as uid 1 at (row, col) facing RIGHT, plus `others`. */
|
||||
function field({ tier = 5, elite = false, mod = null, skill = 2, row = 10, col = 5, others = [], seed = 5 } = {}) {
|
||||
const h = makeBattle({
|
||||
defs: { enemies: ENEMIES }, timeLimit: 900, autoFinish: false, seed,
|
||||
flags: { dpPerSec: 0, dpMax: 999 }, hooks: ['damaged', 'heal', 'skillStart', 'skillEnd', 'statusApplied', 'fatal'], captureNoisy: true,
|
||||
units: [{ uid: 1, diy: { slot: SLOT[tier], charId: HUANG, skillIndex: skill, uniEquipId: mod }, elite, row, col }, ...others],
|
||||
});
|
||||
h.step();
|
||||
return { h, u: h.unit(1) };
|
||||
}
|
||||
const hitsBy = (h, u) => h.hooksOf('damaged').filter((c) => c.source === u && c.target?.side === 'enemy');
|
||||
function done(h) {
|
||||
checkInvariants(h.b);
|
||||
assert.equal(h.b.errors.length, 0, JSON.stringify(h.b.errors[0]));
|
||||
}
|
||||
|
||||
test('煌 in every 自选 form: her operator kit (all three skills authored), the form\'s stats + module attributes, 1-1 range, blocks 3 and strikes every blocked enemy, melee ground-only, 炎 + 维多利亚, no 特质', () => {
|
||||
assert.equal(OPERATOR_KITS[HUANG], KITS[HUANG]);
|
||||
for (const f of FORMS_ALL) {
|
||||
const [tier, elite, mod] = f;
|
||||
for (const skill of [0, 1, 2]) {
|
||||
const { h, u } = field({ tier, elite, mod, skill });
|
||||
const form = formOf(tier, elite), m = elite ? modOf(tier, mod) : null;
|
||||
assert.deepEqual([u.def.charId, u.def.diyFor, u.skill.id, !!u.kit.generic, u.kit.skillSource], [HUANG, SLOT[tier], form.skills[skill].skillId, false, 'skills'], label(f));
|
||||
assert.deepEqual([u.base.maxHp, u.base.atk, u.base.def], [form.stats.maxHp + (m?.attr.maxHp ?? 0), form.stats.atk + (m?.attr.atk ?? 0), form.stats.def + (m?.attr.def ?? 0)], `${label(f)}: stats`);
|
||||
assert.deepEqual([u.s.blockCnt, u.profile.hitAllBlocked, u.profile.attack, u.profile.canHitFly, u.profile.dmgType, u.base.bat], [3, true, 'melee', false, 'phys', 1.2], `${label(f)}: 强攻手`);
|
||||
assert.deepEqual(u.liveRangeGrid, form.rangeGrid, `${label(f)}: 1-1`);
|
||||
assert.deepEqual([u.def.bonds, u.def.raw.garrisonIds], [['yanShip', 'victoriaShip'], []], `${label(f)}: bonds / 特质`);
|
||||
assert.ok(!u.s.flags.liftoff && !u.s.flags.camou && !u.s.flags.stealth && !u.s.flags.untargetable, `${label(f)}: ground enemies target her`);
|
||||
done(h);
|
||||
}
|
||||
}
|
||||
// the numbers of the forms (zh_CN): E2 Lv1 2115 / 581 / 303, E2 Lv60 2583 / 703 / 347; CEN-X +240 / +50 → +285 / +86
|
||||
// HP / ATK, CEN-Y +300 / +40 → +345 / +66
|
||||
assert.deepEqual([FORMS['2/1/4/0'].stats.maxHp, FORMS['2/1/4/0'].stats.atk, FORMS['2/60/7/1'].stats.maxHp, FORMS['2/60/7/1'].stats.atk], [2115, 581, 2583, 703]);
|
||||
assert.deepEqual([modOf(5, CENX).attr, modOf(6, CENX).attr, modOf(5, CENY).attr, modOf(6, CENY).attr], [{ maxHp: 240, atk: 50 }, { maxHp: 285, atk: 86 }, { maxHp: 300, atk: 40 }, { maxHp: 345, atk: 66 }]);
|
||||
});
|
||||
|
||||
test('a 自选 pick: 煌 is offered at tiers 5 and 6 (she has a kit) and a roster with her passes validateDiyPicks', () => {
|
||||
const data = { chess: CHESS, backups: BACKUPS };
|
||||
assert.ok(KITTED_CHARS.includes(HUANG));
|
||||
for (const t of [5, 6]) assert.ok(diyPool(t, { data, kitted: KITTED_CHARS }).includes(HUANG), `tier ${t}`);
|
||||
assert.deepEqual(validateDiyPicks({ [SLOT[5]]: { charId: HUANG, skillIndex: 2, uniEquipId: CENY } }, { data, kitted: KITTED_CHARS }),
|
||||
{ ok: true, picks: { [SLOT[5]]: { charId: HUANG, skillIndex: 2, uniEquipId: CENY } } });
|
||||
});
|
||||
|
||||
test('S1 强力击·γ型 (AUTO, attack SP 3, data DEFAULT): her 4th attack is the skill one — 205 % / 225 % ATK on every enemy she blocks', () => {
|
||||
for (const [tier, elite] of [[5, false], [6, true]]) {
|
||||
const sk = skillOf(tier, elite, S1);
|
||||
const { h, u } = field({ tier, elite, skill: 0, row: 9 });
|
||||
assert.deepEqual([u.skill.rule, u.skill.spType, u.skill.spCost, sk.initSp, sk.bb.atk_scale], ['DEFAULT', 'attack', 3, 0, elite ? 2.25 : 2.05], `T${tier}`);
|
||||
const foes = [0, 1, 2].map(() => h.spawn('enemy_dummy', { pos: [9, 5] }));
|
||||
h.step();
|
||||
assert.equal(u.blocking.length, 3, `T${tier}: blocks all three`);
|
||||
assert.ok(h.runUntil(() => u.skill.activations === 1, 10), `T${tier}: cast`);
|
||||
h.step();
|
||||
const attacks = [...new Set(hitsBy(h, u).map((c) => c.dmg.attackId))];
|
||||
assert.equal(attacks.length, 4, `T${tier}: the 4th attack (3 SP, then the skill attack)`);
|
||||
const last = hitsBy(h, u).filter((c) => c.dmg.attackId === attacks[3]);
|
||||
assert.deepEqual(last.map((c) => c.target).sort((a, b) => a.id - b.id), foes.sort((a, b) => a.id - b.id), `T${tier}: every blocked enemy`);
|
||||
for (const c of last) {
|
||||
approx(c.amount, u.s.atk * sk.bb.atk_scale, `T${tier}: ${sk.bb.atk_scale * 100} %`);
|
||||
assert.deepEqual([c.type, c.dmg.isSkill], ['phys', true]);
|
||||
}
|
||||
for (const c of hitsBy(h, u).filter((c) => c.dmg.attackId !== attacks[3])) approx(c.amount, u.s.atk, `T${tier}: plain attacks`);
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('S2 链锯延伸模块 (AUTO, 持续时间无限): on as soon as its 85 / 80 SP are full — no enemy needed —, ATK +55 % / +70 %, DEF +15 % / +20 %, range 2-2, never ends', () => {
|
||||
for (const [tier, elite] of [[5, false], [6, true]]) {
|
||||
const sk = skillOf(tier, elite, S2);
|
||||
const { h, u } = field({ tier, elite, skill: 1 });
|
||||
assert.deepEqual([u.skill.kind, u.skill.rule, u.skill.spCost, sk.initSp, sk.bb.atk, sk.bb.def, sk.duration], ['toggle', 'SP_FULL', elite ? 80 : 85, 0, elite ? 0.7 : 0.55, elite ? 0.2 : 0.15, -1], `T${tier}`);
|
||||
h.run(sk.spCost - 1);
|
||||
assert.equal(u.skill.activations, 0, `T${tier}: not before its SP is full`);
|
||||
assert.ok(h.runUntil(() => u.skill.active, 2), `T${tier}: on at full SP, no enemy on the field`);
|
||||
approx(u.s.atk, u.base.atk * (1 + sk.bb.atk), `T${tier}: ATK`);
|
||||
approx(u.s.def, u.base.def * (1 + sk.bb.def), `T${tier}: DEF`);
|
||||
assert.deepEqual(u.liveRangeGrid, sk.rangeGrid, `T${tier}: 2-2`);
|
||||
assert.deepEqual(sk.rangeGrid, [[0, 0], [0, 1], [0, 2]]);
|
||||
const far = h.spawn('enemy_dummy', { pos: [10, 7] });
|
||||
h.run(3);
|
||||
assert.ok(hitsBy(h, u).some((c) => c.target === far), `T${tier}: strikes two tiles ahead`);
|
||||
h.run(300);
|
||||
assert.ok(u.skill.active, `T${tier}: still on (持续时间无限)`);
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('S3 沸腾爆裂 (data DEFAULT, 维持技能状态, 10 s): no normal attack; a cut every second for 8 s on the ground enemies of her 1-1 (not air), ATK / DEF ramp to +45 % / +60 % (full at 8.95 s); at 9 s −25 % max HP (never below 1) and 320 % / 340 % on the 3 × 3 ahead, air too', () => {
|
||||
for (const [tier, elite] of [[5, false], [6, true]]) {
|
||||
const sk = skillOf(tier, elite, S3);
|
||||
const { h, u } = field({ tier, elite, skill: 2 });
|
||||
assert.deepEqual([u.skill.rule, u.skill.kind, sk.duration, sk.bb.atk, sk.bb.def, sk.bb.hp_ratio, sk.bb.damage_by_atk_scale, sk.rangeGrid],
|
||||
['DEFAULT', 'duration', 10, elite ? 0.6 : 0.45, elite ? 0.6 : 0.45, 0.25, elite ? 3.4 : 3.2, null], `T${tier}`);
|
||||
const front = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
const own = h.spawn('enemy_dummy', { pos: [10, 5] });
|
||||
const flyIn = h.spawn('enemy_fly', { pos: [10, 6] });
|
||||
const side = h.spawn('enemy_dummy', { pos: [9, 6] }); // 3-6, not 1-1
|
||||
const ahead2 = h.spawn('enemy_dummy', { pos: [10, 7] }); // 3-6, not 1-1
|
||||
const flySide = h.spawn('enemy_fly', { pos: [11, 7] }); // 3-6 (air)
|
||||
const outside = h.spawn('enemy_dummy', { pos: [10, 8] });
|
||||
u.skill.gainSp(999);
|
||||
assert.ok(h.runUntil(() => u.skill.active, 3), `T${tier}: cast with an enemy in her range`);
|
||||
const t0 = h.b.time;
|
||||
approx(u.s.atk, u.base.atk, `T${tier}: no bonus before the first update`);
|
||||
const at = [], hits = [];
|
||||
let ended = false, lossAt = null;
|
||||
h.b.on('damaged', (c) => { if (c.target === u && c.dmg?.tags?.includes('hpLoss')) lossAt = h.b.time - t0; });
|
||||
h.b.on('skillEnd', (c) => { if (c.unit === u) ended = true; });
|
||||
h.b.on('damaged', (c) => {
|
||||
if (c.source !== u || c.target?.side !== 'enemy' || ended) return;
|
||||
hits.push(c);
|
||||
if (c.target === front) at.push({ t: h.b.time - t0, amt: c.amount, atk: u.s.atk, def: u.s.def });
|
||||
});
|
||||
h.runUntil(() => !u.skill.active, 12);
|
||||
const span = h.b.time - t0;
|
||||
assert.ok(span > 9.9 && span < 10.1, `T${tier}: the state lasts its 10 s (${span})`);
|
||||
approx(lossAt, 9, `T${tier}: the finish at 9 s`, 0.05);
|
||||
approx(at[8].t, 9, `T${tier}: the burst at 9 s`, 0.05);
|
||||
assert.ok(hits.every((c) => c.dmg.isSkill && !c.dmg.isAttack), `T${tier}: no normal attack while it runs`);
|
||||
const cutsOn = (e) => hits.filter((c) => c.target === e).length;
|
||||
assert.deepEqual([cutsOn(front), cutsOn(own)], [9, 9], `T${tier}: 8 cuts + the burst on her 1-1`);
|
||||
assert.deepEqual([cutsOn(flyIn), cutsOn(side), cutsOn(ahead2), cutsOn(flySide), cutsOn(outside)], [1, 1, 1, 1, 0], `T${tier}: the burst alone on the 3 × 3 (air too); nothing outside`);
|
||||
const D = sk.duration - 1.05;
|
||||
for (let k = 1; k <= 8; k++) {
|
||||
const c = at[k - 1];
|
||||
approx(c.t, k, `T${tier}: cut ${k} at ${k} s`, 0.05);
|
||||
approx(c.atk, u.base.atk * (1 + sk.bb.atk * Math.min(1, k / D)), `T${tier}: ATK at cut ${k}`);
|
||||
approx(c.def, u.base.def * (1 + sk.bb.def * Math.min(1, k / D)), `T${tier}: DEF at cut ${k}`);
|
||||
approx(c.amt, c.atk, `T${tier}: cut ${k} = 100 % ATK`);
|
||||
}
|
||||
approx(at[8].amt, u.base.atk * (1 + sk.bb.atk) * sk.bb.damage_by_atk_scale, `T${tier}: the burst at full ATK`);
|
||||
const loss = h.hooksOf('damaged').filter((c) => c.target === u && c.dmg?.tags?.includes('hpLoss'));
|
||||
assert.equal(loss.length, 1, `T${tier}: one 流失`);
|
||||
approx(loss[0].amount, u.s.maxHp * 0.25, `T${tier}: 25 % of MAX HP`);
|
||||
assert.equal(u.findBuff('skill:huang:ramp'), null, `T${tier}: the bonus goes with the skill`);
|
||||
approx(u.s.atk, u.base.atk, `T${tier}: ATK back`);
|
||||
assert.deepEqual(u.liveRangeGrid, formOf(tier, elite).rangeGrid, `T${tier}: her range throughout`);
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('S3 沸腾爆裂: the 流失 never takes her below 1 HP; a 晕眩 ends the 维持技能状态 early — it still finishes (流失 + burst)', () => {
|
||||
const { h, u } = field({ tier: 6, elite: true, skill: 2 });
|
||||
u.skill.gainSp(999);
|
||||
h.run(2);
|
||||
assert.equal(u.skill.activations, 0, 'DEFAULT: no enemy, no cast');
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
assert.ok(h.runUntil(() => u.skill.active, 3));
|
||||
h.run(3.2);
|
||||
const n0 = hitsBy(h, u).filter((c) => c.target === e).length;
|
||||
assert.equal(n0, 3, 'three cuts');
|
||||
h.b.applyStatus(u, 'stun', { duration: 2, source: e });
|
||||
h.step();
|
||||
assert.ok(!u.skill.active, 'the stun ended it');
|
||||
const after = hitsBy(h, u).filter((c) => c.target === e);
|
||||
assert.equal(after.length, 4, 'the burst on its end');
|
||||
approx(after[3].amount, u.base.atk * (1 + 0.6 * 3 / 8.95) * 3.4, 'the burst at the ATK of that moment (three updates)');
|
||||
done(h);
|
||||
// the non-lethal 流失: at 10 % HP the skill end leaves her at 1 HP (her 紧急除颤 then fires: HP ≤ 25 %)
|
||||
const r = field({ tier: 5, elite: false, skill: 2 });
|
||||
r.h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
r.u.mem.huangDefib.undeadA = false; // talent already spent: only the 流失's own floor
|
||||
r.u.hp = r.u.s.maxHp * 0.1;
|
||||
r.u.skill.gainSp(999);
|
||||
assert.ok(r.h.runUntil(() => r.u.skill.active, 3));
|
||||
r.h.runUntil(() => !r.u.skill.active, 12);
|
||||
assert.ok(r.u.alive && Math.abs(r.u.hp - 1) < 1e-6, `left at 1 HP (${r.u.hp})`);
|
||||
done(r.h);
|
||||
});
|
||||
|
||||
test('T1 紧急除颤: 不死 until her HP first reaches ≤ 25 % — then +50 % max HP and for 6 s no damage takes her below 50 % (a 流失 still does); once per deployment, again after a redeploy', () => {
|
||||
for (const f of [[5, false, null], [6, true, CENX], [5, true, CENY]]) {
|
||||
const [tier, elite, mod] = f;
|
||||
const { h, u } = field({ tier, elite, mod, skill: 0 });
|
||||
const t0 = u.def.raw.talents.find((t) => t.index === 0).bb;
|
||||
assert.deepEqual([t0.hp_ratio, t0['huang_t_1[heal].hp_ratio'], t0['huang_t_1[lock].min_hp_ratio'], t0['huang_t_1[lock].duration']], [0.25, 0.5, 0.5, 6], label(f));
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
const max = u.s.maxHp;
|
||||
// a lethal hit from full HP: 不死 keeps her at 1 HP, the talent heals 50 %
|
||||
h.b.dealDamage(e, u, { amount: max * 5, type: 'true' });
|
||||
assert.ok(u.alive, `${label(f)}: 不死`);
|
||||
approx(u.hp, 1 + max * 0.5, `${label(f)}: 1 HP + 50 %`);
|
||||
const lockStart = h.b.time;
|
||||
// inside 6 s: a 60 % hit stops at exactly 50 %
|
||||
h.b.dealDamage(e, u, { amount: max * 0.6, type: 'true' });
|
||||
approx(u.hp, max * 0.5, `${label(f)}: held at 50 %`);
|
||||
h.b.dealDamage(e, u, { amount: max * 0.3, type: 'true' });
|
||||
approx(u.hp, max * 0.5, `${label(f)}: below 50 % nothing passes`);
|
||||
h.b.loseHp(u, max * 0.1, { source: e });
|
||||
approx(u.hp, max * 0.4, `${label(f)}: a 流失 is not held`);
|
||||
h.run(6 - (h.b.time - lockStart) + 0.1);
|
||||
h.b.dealDamage(e, u, { amount: max * 0.3, type: 'true' });
|
||||
approx(u.hp, max * 0.1, `${label(f)}: the lock is over`);
|
||||
h.b.dealDamage(e, u, { amount: max, type: 'true' });
|
||||
assert.ok(!u.alive, `${label(f)}: spent — the next lethal hit kills`);
|
||||
// a redeploy re-arms it
|
||||
h.b.redeploy(u);
|
||||
h.step();
|
||||
h.b.dealDamage(e, u, { amount: u.s.maxHp * 0.8, type: 'true' });
|
||||
approx(u.hp, u.s.maxHp * 0.7, `${label(f)}: again after the redeploy (20 % + 50 %)`);
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('T2 严酷训练: 15 s after each deployment 抵抗 (control statuses last half as long); CEN-X stage 3 adds ATK +6 % after 30 s and ASPD +12 after 45 s (stage 1: nothing more)', () => {
|
||||
for (const f of [[5, false, null], [5, true, CENX], [6, true, CENX], [6, true, CENY]]) {
|
||||
const [tier, elite, mod] = f;
|
||||
const { h, u } = field({ tier, elite, mod, skill: 0 });
|
||||
const x3 = tier === 6 && mod === CENX;
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
h.run(14.8);
|
||||
assert.equal(h.b.resistOf(u), 0, `${label(f)}: no 抵抗 before 15 s`);
|
||||
h.run(0.4);
|
||||
assert.equal(h.b.resistOf(u), 0.5, `${label(f)}: 抵抗 at 15 s`);
|
||||
h.b.applyStatus(u, 'stun', { duration: 2, source: e });
|
||||
approx(u.findBuff('stun').timeLeft, 1, `${label(f)}: a 2 s stun lasts 1 s`);
|
||||
h.run(15);
|
||||
assert.equal(!!u.findBuff('talent:huang:atk'), x3, `${label(f)}: ATK +6 % after 30 s`);
|
||||
if (x3) approx(u.s.atk, u.base.atk * 1.06, 'ATK +6 %');
|
||||
h.run(15);
|
||||
assert.equal(!!u.findBuff('talent:huang:aspd'), x3, `${label(f)}: ASPD +12 after 45 s`);
|
||||
if (x3) assert.equal(u.s.aspd, 112);
|
||||
// per deployment: knocked out and back, the timer starts again
|
||||
h.b.kill(u, e);
|
||||
assert.ok(!u.alive);
|
||||
h.b.redeploy(u);
|
||||
h.step();
|
||||
assert.deepEqual([h.b.resistOf(u), !!u.findBuff('talent:huang:atk')], [0, false], `${label(f)}: reset by the redeploy`);
|
||||
h.run(15.2);
|
||||
assert.equal(h.b.resistOf(u), 0.5, `${label(f)}: 抵抗 again 15 s later`);
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('CEN-X (stages 1 and 3): ×1.1 ATK scale on every damage of hers to a blocked enemy (normal attacks and S3 cuts) — none to an unblocked one; none without the module', () => {
|
||||
for (const f of [[5, true, null], [5, true, CENX], [6, true, CENX], [6, true, CENY]]) {
|
||||
const [tier, elite, mod] = f;
|
||||
const mul = mod === CENX ? 1.1 : 1;
|
||||
if (mod === CENX) assert.deepEqual(formOf(tier, true).modules.find((m) => m.uniEquipId === CENX).traitOverride.bb, { atk_scale: 1.1 });
|
||||
const { h, u } = field({ tier, elite, mod, skill: 2, row: 9 });
|
||||
const blocked = h.spawn('enemy_dummy', { pos: [9, 5] });
|
||||
h.step();
|
||||
assert.equal(blocked.blockedBy, u, `${label(f)}: blocked`);
|
||||
h.run(3);
|
||||
const plain = hitsBy(h, u).filter((c) => c.target === blocked && !c.dmg.isSkill);
|
||||
assert.ok(plain.length >= 2, label(f));
|
||||
for (const c of plain) approx(c.amount, u.s.atk * mul, `${label(f)}: blocked target`);
|
||||
const free = h.spawn('enemy_dummy', { pos: [9, 6] });
|
||||
u.skill.gainSp(999);
|
||||
assert.ok(h.runUntil(() => u.skill.active, 3));
|
||||
h.run(1.1);
|
||||
const cut = hitsBy(h, u).filter((c) => c.dmg.isSkill);
|
||||
approx(cut.find((c) => c.target === blocked).amount, u.s.atk * mul, `${label(f)}: S3 cut on the blocked one`);
|
||||
approx(cut.find((c) => c.target === free).amount, u.s.atk, `${label(f)}: S3 cut on the free one`);
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('CEN-Y stage 1: −20 % physical damage taken above 50 % HP (arts untouched); stage 3: 紧急除颤 at 50 % then a second trigger at 25 % (its own 不死, 8 s), and 150 DEF ignored while above 50 %', () => {
|
||||
for (const tier of [5, 6]) {
|
||||
const { h, u } = field({ tier, elite: true, mod: CENY, skill: 0 });
|
||||
assert.deepEqual(u.def.raw.trait.bb, { hp_ratio: 0.5, damage_resistance: 0.2 });
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
h.step();
|
||||
assert.equal(u.s.defIgnoreFlat, tier === 6 ? 150 : 0, `T${tier}: 150 DEF ignored above 50 % from stage 2 on`);
|
||||
const max = u.s.maxHp;
|
||||
let hp = u.hp;
|
||||
h.b.dealDamage(e, u, { amount: 1000, type: 'phys' });
|
||||
approx(hp - u.hp, Math.max(1000 - u.s.def, 50) * 0.8, `T${tier}: physical ×0.8`);
|
||||
hp = u.hp;
|
||||
h.b.dealDamage(e, u, { amount: 300, type: 'arts' });
|
||||
approx(hp - u.hp, 300, `T${tier}: arts untouched`);
|
||||
hp = u.hp;
|
||||
h.b.dealDamage(e, u, { amount: 200, type: 'true' });
|
||||
approx(hp - u.hp, 200, `T${tier}: true untouched`);
|
||||
u.mem.huangDefib.undeadA = u.mem.huangDefib.undeadB = false; // (stage 3's talent would fire at 50 %)
|
||||
u.hp = max * 0.5;
|
||||
hp = u.hp;
|
||||
h.b.dealDamage(e, u, { amount: 1000, type: 'phys' });
|
||||
approx(hp - u.hp, Math.max(1000 - u.s.def, 50), `T${tier}: at 50 % (not above) the full physical damage`);
|
||||
done(h);
|
||||
}
|
||||
// stage 3: the talent fires at 50 % (8 s), the hidden part at 25 % — only once the first is spent
|
||||
const { h, u } = field({ tier: 6, elite: true, mod: CENY, skill: 0 });
|
||||
const t0 = u.def.raw.talents.find((t) => t.index === 0).bb;
|
||||
const hid = Object.assign({}, ...u.def.raw.talents.filter((t) => t.index === -1).map((t) => t.bb));
|
||||
assert.deepEqual([t0.hp_ratio, t0['huang_t_1[lock].duration'], hid.def_penetrate_fixed, hid['huang_e_003[lock].check_hp_ratio'], hid['huang_e_003[lock].duration']], [0.5, 8, 150, 0.25, 8]);
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
h.step();
|
||||
assert.equal(u.s.defIgnoreFlat, 150, 'above 50 %: 150 DEF ignored');
|
||||
const max = u.s.maxHp;
|
||||
h.b.dealDamage(e, u, { amount: max * 0.6, type: 'true' }); // 100 % → 40 %: the 50 % trigger
|
||||
approx(u.hp, max * 0.9, '50 % trigger: +50 %');
|
||||
h.run(8.2);
|
||||
h.b.dealDamage(e, u, { amount: max * 0.3, type: 'true' }); // 90 % → 60 %
|
||||
h.step();
|
||||
assert.equal(u.s.defIgnoreFlat, 150);
|
||||
h.b.dealDamage(e, u, { amount: max * 0.2, type: 'true' }); // 60 % → 40 %: nothing (the first is spent)
|
||||
approx(u.hp, max * 0.4, 'no second 50 % trigger');
|
||||
h.step();
|
||||
assert.equal(u.s.defIgnoreFlat, 0, 'at 40 % the DEF penetration is off');
|
||||
h.b.dealDamage(e, u, { amount: max * 5, type: 'true' }); // lethal: its own 不死, then the 25 % trigger
|
||||
assert.ok(u.alive, 'the second 不死');
|
||||
approx(u.hp, 1 + max * 0.5, '25 % trigger: +50 %');
|
||||
h.b.dealDamage(e, u, { amount: max * 0.4, type: 'true' });
|
||||
approx(u.hp, max * 0.5, 'its 8 s lock holds 50 %');
|
||||
h.run(8.2);
|
||||
h.b.dealDamage(e, u, { amount: max, type: 'true' });
|
||||
assert.ok(!u.alive, 'both spent');
|
||||
done(h);
|
||||
// a single hit from above 50 % to 10 %: the 50 % trigger first (+50 % ⇒ 60 %), the 25 % one waits for a later drop
|
||||
const r = field({ tier: 6, elite: true, mod: CENY, skill: 0 });
|
||||
const e2 = r.h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
const m2 = r.u.s.maxHp;
|
||||
r.h.b.dealDamage(e2, r.u, { amount: m2 * 0.9, type: 'true' });
|
||||
approx(r.u.hp, m2 * 0.6, 'the 50 % trigger first');
|
||||
assert.deepEqual([r.u.mem.huangDefib.undeadA, r.u.mem.huangDefib.undeadB], [false, true], 'the 25 % trigger still armed');
|
||||
done(r.h);
|
||||
});
|
||||
@@ -0,0 +1,374 @@
|
||||
// test/content/op_zuole.test.js — the 自选 operator kit of 左乐 (char_4121_zuole, 6★ 武者; kit
|
||||
// server/sim/content/kits/ops/op-zuole.js), fielded the production way (a DIY slot + its `diy` pick, simdata getDiy) in
|
||||
// every form: tiers 5 / 6, normal (E2 Lv1, skill rank 4, no module) and elite (E2 Lv60, rank 7) with no module, SBL-X
|
||||
// “岂苦夜长” or SBL-Y “秉烛人的记录” at stage 1 (tier 5) / 3 (tier 6). Every number is read back from data/backups.json
|
||||
// (the form of that slot status); the fidelity checklist of kits/README.md item by item.
|
||||
// Run: node --test test/content/op_zuole.test.js
|
||||
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { makeBattle, enemyRec, checkInvariants } from '../helpers/battleHarness.js';
|
||||
import { KITTED_CHARS, OPERATOR_KITS, KITS } from '../../server/sim/content/kits/index.js';
|
||||
import { diyPool, validateDiyPicks } from '../../shared/diy.js';
|
||||
|
||||
const load = (f) => JSON.parse(readFileSync(new URL(`../../data/${f}.json`, import.meta.url), 'utf8'));
|
||||
const CHESS = load('chess');
|
||||
const BACKUPS = load('backups');
|
||||
const ZUOLE = 'char_4121_zuole';
|
||||
const FORMS = BACKUPS.units[ZUOLE].forms;
|
||||
const SLOT = { 5: 'chess_char_5_diy1_a', 6: 'chess_char_6_diy1_a' };
|
||||
const SBLX = 'uniequip_002_zuole', SBLY = 'uniequip_003_zuole';
|
||||
const S1 = 'skchr_zuole_1', S2 = 'skchr_zuole_2', S3 = 'skchr_zuole_3';
|
||||
const formOf = (tier, elite) => FORMS[elite ? (tier === 5 ? '2/60/7/1' : '2/60/7/3') : '2/1/4/0'];
|
||||
const skillOf = (tier, elite, id) => formOf(tier, elite).skills.find((s) => s.skillId === id);
|
||||
const modOf = (tier, mod) => (mod ? formOf(tier, true).modules.find((m) => m.uniEquipId === mod) : null);
|
||||
const approx = (a, b, msg, eps = 1e-6) => assert.ok(Math.abs(a - b) <= eps * Math.max(1, Math.abs(b)), `${msg}: ${a} vs ${b}`);
|
||||
const dummy = (key, o = {}) => enemyRec({ key, hp: 1e9, speed: 0, mass: 0, ...o });
|
||||
const ENEMIES = {
|
||||
enemy_dummy: dummy('enemy_dummy'), enemy_fly: dummy('enemy_fly', { motion: 'FLY' }),
|
||||
enemy_walk: enemyRec({ key: 'enemy_walk', hp: 1e9, speed: 0.6, mass: 0 }),
|
||||
};
|
||||
/** Every 自选 form: [tier, elite, module]. */
|
||||
const FORMS_ALL = [[5, false, null], [6, false, null], ...[5, 6].flatMap((t) => [null, SBLX, SBLY].map((m) => [t, true, m]))];
|
||||
const label = ([tier, elite, mod]) => `T${tier} ${elite ? 'elite' : 'normal'} ${mod ?? 'none'}`;
|
||||
|
||||
/** A battle with 左乐 as uid 1 at (row, col) facing RIGHT, plus `others`. */
|
||||
function field({ tier = 5, elite = false, mod = null, skill = 2, row = 10, col = 5, others = [], seed = 5 } = {}) {
|
||||
const h = makeBattle({
|
||||
defs: { enemies: ENEMIES }, timeLimit: 900, autoFinish: false, seed,
|
||||
flags: { dpPerSec: 0, dpMax: 999 }, hooks: ['damaged', 'heal', 'skillStart', 'skillEnd', 'statusApplied', 'fatal'], captureNoisy: true,
|
||||
units: [{ uid: 1, diy: { slot: SLOT[tier], charId: ZUOLE, skillIndex: skill, uniEquipId: mod }, elite, row, col }, ...others],
|
||||
});
|
||||
h.step();
|
||||
return { h, u: h.unit(1) };
|
||||
}
|
||||
const hitsBy = (h, u) => h.hooksOf('damaged').filter((c) => c.source === u && c.target?.side === 'enemy');
|
||||
const healsOf = (h, u) => h.hooksOf('heal').filter((c) => c.target === u);
|
||||
/** Keep 守正自明 / 坚忍 SP out of the way: no SP of any kind (阻回). */
|
||||
const noSp = (h, u) => h.b.addBuff(u, { key: 'test:noSp', flags: { noSp: true }, duration: Infinity });
|
||||
function done(h) {
|
||||
checkInvariants(h.b);
|
||||
assert.equal(h.b.errors.length, 0, JSON.stringify(h.b.errors[0]));
|
||||
}
|
||||
|
||||
test('左乐 in every 自选 form: his operator kit (all three skills authored), the form\'s stats + module attributes, 1-1 range, blocks 1, melee ground-only, 炎, no 特质; 武者: no heal from others, 70 HP per enemy hit', () => {
|
||||
assert.equal(OPERATOR_KITS[ZUOLE], KITS[ZUOLE]);
|
||||
for (const f of FORMS_ALL) {
|
||||
const [tier, elite, mod] = f;
|
||||
for (const skill of [0, 1, 2]) {
|
||||
const { h, u } = field({ tier, elite, mod, skill });
|
||||
const form = formOf(tier, elite), m = elite ? modOf(tier, mod) : null;
|
||||
assert.deepEqual([u.def.charId, u.def.diyFor, u.skill.id, !!u.kit.generic, u.kit.skillSource], [ZUOLE, SLOT[tier], form.skills[skill].skillId, false, 'skills'], label(f));
|
||||
assert.deepEqual([u.base.maxHp, u.base.atk, u.base.def], [form.stats.maxHp + (m?.attr.maxHp ?? 0), form.stats.atk + (m?.attr.atk ?? 0), form.stats.def + (m?.attr.def ?? 0)], `${label(f)}: stats`);
|
||||
assert.deepEqual([u.s.blockCnt, u.profile.attack, u.profile.canHitFly, u.profile.dmgType, u.profile.noHeal, u.profile.selfHeal, u.base.bat], [1, 'melee', false, 'phys', true, 70, 1.2], `${label(f)}: 武者`);
|
||||
assert.deepEqual(u.liveRangeGrid, form.rangeGrid, `${label(f)}: 1-1`);
|
||||
assert.deepEqual([u.def.bonds, u.def.raw.garrisonIds], [['yanShip'], []], `${label(f)}: bonds / 特质`);
|
||||
assert.ok(!u.s.flags.liftoff && !u.s.flags.camou && !u.s.flags.stealth && !u.s.flags.untargetable, `${label(f)}: ground enemies target him`);
|
||||
done(h);
|
||||
}
|
||||
}
|
||||
// the numbers of the forms (zh_CN): E2 Lv1 2893 / 647 / 267, E2 Lv60 3533 / 735 / 299; SBL-X +55 / +40 → +90 / +60
|
||||
// ATK / DEF, SBL-Y +300 / +60 → +380 / +84 HP / ATK
|
||||
assert.deepEqual([FORMS['2/1/4/0'].stats.maxHp, FORMS['2/1/4/0'].stats.atk, FORMS['2/60/7/1'].stats.maxHp, FORMS['2/60/7/1'].stats.atk], [2893, 647, 3533, 735]);
|
||||
assert.deepEqual([modOf(5, SBLX).attr, modOf(6, SBLX).attr, modOf(5, SBLY).attr, modOf(6, SBLY).attr], [{ atk: 55, def: 40 }, { atk: 90, def: 60 }, { maxHp: 300, atk: 60 }, { maxHp: 380, atk: 84 }]);
|
||||
});
|
||||
|
||||
test('a 自选 pick: 左乐 is offered at tiers 5 and 6 (he has a kit) and a roster with him passes validateDiyPicks', () => {
|
||||
const data = { chess: CHESS, backups: BACKUPS };
|
||||
assert.ok(KITTED_CHARS.includes(ZUOLE));
|
||||
for (const t of [5, 6]) assert.ok(diyPool(t, { data, kitted: KITTED_CHARS }).includes(ZUOLE), `tier ${t}`);
|
||||
assert.deepEqual(validateDiyPicks({ [SLOT[5]]: { charId: ZUOLE, skillIndex: 1, uniEquipId: SBLX } }, { data, kitted: KITTED_CHARS }),
|
||||
{ ok: true, picks: { [SLOT[5]]: { charId: ZUOLE, skillIndex: 1, uniEquipId: SBLX } } });
|
||||
});
|
||||
|
||||
test('trait (武者): +70 HP on every enemy hit, none from another unit\'s heal', () => {
|
||||
const { h, u } = field({ tier: 5, elite: true, skill: 1 });
|
||||
noSp(h, u);
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
u.hp = u.s.maxHp * 0.6;
|
||||
const hp0 = u.hp;
|
||||
h.runUntil(() => hitsBy(h, u).length >= 3, 6);
|
||||
approx(u.hp - hp0, 70 * hitsBy(h, u).length, 'one heal of 70 per hit');
|
||||
assert.equal(h.b.heal(e, u, 500), 0, 'no heal from another unit');
|
||||
done(h);
|
||||
});
|
||||
|
||||
test('S1 破虏 (AUTO, 2 charges, data DEFAULT): the next attack at 145 % / 160 %; below 80 % HP one more strike, below 50 % two more — each a damage instance of its own (and a trait heal)', () => {
|
||||
for (const [tier, elite] of [[5, false], [6, true]]) {
|
||||
const sk = skillOf(tier, elite, S1);
|
||||
assert.deepEqual([sk.skillType, sk.spType, sk.spCost, sk.initSp, sk.maxChargeTime, sk.bb.atk_scale, sk.bb.hp_ratio_double, sk.bb.hp_ratio_tripple],
|
||||
['AUTO', 'INCREASE_WITH_TIME', elite ? 5 : 6, elite ? 4 : 2, 2, elite ? 1.6 : 1.45, 0.8, 0.5], `T${tier}`);
|
||||
for (const [ratio, strikes] of [[1, 1], [0.79, 2], [0.49, 3]]) {
|
||||
const { h, u } = field({ tier, elite, skill: 0 });
|
||||
assert.deepEqual([u.skill.rule, u.skill.maxCharges], ['DEFAULT', 2], `T${tier}`);
|
||||
noSp(h, u);
|
||||
u.skill.sp = 0;
|
||||
u.skill.charges = 1;
|
||||
u.hp = u.s.maxHp * ratio;
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
assert.ok(h.runUntil(() => u.skill.activations === 1, 2), `T${tier}: cast`);
|
||||
h.step();
|
||||
const sk1 = hitsBy(h, u).filter((c) => c.dmg.isSkill);
|
||||
assert.equal(sk1.length, strikes, `T${tier} at ${ratio * 100} % HP: ${strikes} strike(s)`);
|
||||
for (const c of sk1) {
|
||||
assert.equal(c.target, e);
|
||||
approx(c.amount, u.s.atk * sk.bb.atk_scale, `T${tier}: ${sk.bb.atk_scale * 100} %`);
|
||||
assert.equal(c.type, 'phys');
|
||||
}
|
||||
assert.equal(healsOf(h, u).filter((c) => c.opts?.self && !c.opts?.tags).length, strikes, `T${tier}: a trait heal per strike`);
|
||||
done(h);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('S2 行险 (MANUAL, 12 s, data DEFAULT): −50 % current HP (never below 1), a barrier of 75 % / 90 % max HP stacking to 2× max HP, ATK +110 % / +140 %, block 2, every blocked enemy struck; once over the barrier loses 200 per second', () => {
|
||||
for (const [tier, elite] of [[5, false], [6, true]]) {
|
||||
const sk = skillOf(tier, elite, S2);
|
||||
const { h, u } = field({ tier, elite, skill: 1, row: 9 });
|
||||
assert.deepEqual([u.skill.rule, sk.duration, sk.spCost, sk.initSp, sk.bb.atk, sk.bb.hp_ratio, sk.bb.scale, sk.bb.block_cnt, sk.bb.max_scale, sk.bb.shield_decrease],
|
||||
['DEFAULT', 12, elite ? 24 : 27, elite ? 10 : 5, elite ? 1.4 : 1.1, 0.5, elite ? 0.9 : 0.75, 1, 2, -200], `T${tier}`);
|
||||
noSp(h, u);
|
||||
const max = u.s.maxHp;
|
||||
const a = h.spawn('enemy_dummy', { pos: [9, 5] }), b = h.spawn('enemy_dummy', { pos: [9, 5] });
|
||||
h.step();
|
||||
assert.equal(u.blocking.length, 1, `T${tier}: blocks 1`);
|
||||
const hpAtStart = [];
|
||||
h.b.on('skillStart', (c) => { if (c.unit === u) hpAtStart.push(u.hp); });
|
||||
u.skill.charges = 1;
|
||||
assert.ok(h.runUntil(() => u.skill.active, 3), `T${tier}: cast`);
|
||||
approx(hpAtStart[0], max * 0.5, `T${tier}: −50 % of the current HP`);
|
||||
const bar = () => u.findBuff('skill:zuole:barrier2');
|
||||
approx(bar().shield, max * sk.bb.scale, `T${tier}: barrier ${sk.bb.scale * 100} % max HP`);
|
||||
approx(u.s.atk, u.base.atk * (1 + sk.bb.atk), `T${tier}: ATK`);
|
||||
h.step();
|
||||
assert.deepEqual([u.s.blockCnt, u.blocking.length], [2, 2], `T${tier}: block +1`);
|
||||
const n0 = hitsBy(h, u).length;
|
||||
h.runUntil(() => hitsBy(h, u).length > n0, 3);
|
||||
const atk = hitsBy(h, u).slice(n0);
|
||||
assert.deepEqual(new Set(atk.map((c) => c.target)), new Set([a, b]), `T${tier}: both blocked enemies at once`);
|
||||
// the barrier absorbs damage; it stays put while the skill runs
|
||||
const hpBefore = u.hp;
|
||||
h.b.dealDamage(a, u, { amount: 1000, type: 'true' });
|
||||
approx(bar().shield, max * sk.bb.scale - 1000, `T${tier}: absorbed`);
|
||||
approx(u.hp, hpBefore, `T${tier}: HP untouched`);
|
||||
const left = bar().shield;
|
||||
h.runUntil(() => !u.skill.active, 13);
|
||||
approx(bar().shield, left, `T${tier}: no decay during the skill`);
|
||||
h.run(3.05);
|
||||
approx(bar().shield, left - 600, `T${tier}: −200 per second once over`, 1e-3);
|
||||
// a second cast stacks onto what is left, capped at 2× max HP; the 流失 never goes below 1 HP
|
||||
u.hp = 1;
|
||||
const before = bar().shield;
|
||||
u.skill.charges = 1;
|
||||
assert.ok(h.runUntil(() => u.skill.active, 5), `T${tier}: second cast`);
|
||||
assert.equal(hpAtStart[1], 1, `T${tier}: at 1 HP nothing is lost`);
|
||||
const diff = bar().shield - before, add = max * sk.bb.scale;
|
||||
assert.ok(Math.abs(diff - add) < 1e-6 || Math.abs(diff - (add - 200)) < 1e-6, `T${tier}: stacked onto what was left (${diff} vs ${add}, a decay step at most in between)`);
|
||||
done(h);
|
||||
}
|
||||
// the cap: a cast on a barrier of 1.6× max HP stops at 2×
|
||||
const { h, u } = field({ tier: 6, elite: true, skill: 1 });
|
||||
noSp(h, u);
|
||||
h.b.addBuff(u, { key: 'skill:zuole:barrier2', shield: u.s.maxHp * 1.6, data: { createdAt: 0 } });
|
||||
u.skill.charges = 1;
|
||||
h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
assert.ok(h.runUntil(() => u.skill.active, 3));
|
||||
approx(u.findBuff('skill:zuole:barrier2').shield, u.s.maxHp * 2, 'capped at 2× max HP');
|
||||
done(h);
|
||||
});
|
||||
|
||||
test('S3 佑序有炎 (MANUAL, data SKILL_RANGE on 3-2): 7 slashes on ≤ 3 enemies of the 3-2 (air too) at 205 % / 220 %, the last ×2 and 晕眩 3.5 / 4 s; meanwhile no trait heal — every hit adds 70 × 2.5 / 3 to a barrier (≤ 2× max HP, 15 s from the last gain)', () => {
|
||||
for (const [tier, elite] of [[5, false], [6, true]]) {
|
||||
const sk = skillOf(tier, elite, S3);
|
||||
const { h, u } = field({ tier, elite, skill: 2 });
|
||||
assert.deepEqual([u.skill.rule, sk.rangeId, sk.spCost, sk.initSp, sk.bb.atk_scale, sk.bb.times, sk.bb.stun, sk.bb.last_atk_bonus, sk.bb.shield_scale, sk.bb.shield_duration, sk.bb.max_scale],
|
||||
['SKILL_RANGE', '3-2', elite ? 28 : 29, elite ? 6 : 3, elite ? 2.2 : 2.05, 7, elite ? 4 : 3.5, 2, elite ? 3 : 2.5, 15, 2], `T${tier}`);
|
||||
assert.deepEqual(u.skill.triggerGrid, [[0, 0], [0, 1], [0, 2], [0, 3]], `T${tier}: its 3-2`);
|
||||
noSp(h, u);
|
||||
u.hp = u.s.maxHp * 0.6;
|
||||
const hp0 = u.hp;
|
||||
let hpAtEnd = null;
|
||||
h.b.on('skillEnd', (c) => { if (c.unit === u && hpAtEnd == null) hpAtEnd = u.hp; });
|
||||
u.skill.charges = 1;
|
||||
h.run(1);
|
||||
assert.equal(u.skill.activations, 0, `T${tier}: no enemy on the 3-2, no cast`);
|
||||
const near = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
const mid = h.spawn('enemy_fly', { pos: [10, 7] });
|
||||
const tip = h.spawn('enemy_dummy', { pos: [10, 8] });
|
||||
const fourth = h.spawn('enemy_dummy', { pos: [10, 8] });
|
||||
const beyond = h.spawn('enemy_dummy', { pos: [10, 9] });
|
||||
const side = h.spawn('enemy_dummy', { pos: [9, 6] });
|
||||
h.step();
|
||||
assert.equal(u.skill.activations, 1, `T${tier}: cast as soon as an enemy is on its 3-2`);
|
||||
const slashes = hitsBy(h, u).filter((c) => c.dmg.isSkill);
|
||||
assert.equal(slashes.length, 21, `T${tier}: 7 × 3`);
|
||||
const struck = new Set(slashes.map((c) => c.target));
|
||||
assert.equal(struck.size, 3, `T${tier}: the same three`);
|
||||
assert.ok(struck.has(near) && struck.has(mid), `T${tier}: the flyer too`);
|
||||
assert.ok(!struck.has(beyond) && !struck.has(side), `T${tier}: nothing off the 3-2`);
|
||||
assert.ok(struck.has(tip) !== struck.has(fourth), `T${tier}: one of the two on the tip (at most 3)`);
|
||||
const amt = u.s.atk * sk.bb.atk_scale;
|
||||
for (const [i, c] of slashes.entries()) approx(c.amount, amt * (i >= 18 ? 2 : 1), `T${tier}: slash ${Math.floor(i / 3) + 1}`);
|
||||
const stuns = h.hooksOf('statusApplied').filter((c) => c.source === u && c.status === 'stun');
|
||||
assert.equal(stuns.length, 3, `T${tier}: the last slash stuns`);
|
||||
for (const c of stuns) approx(c.duration, sk.bb.stun, `T${tier}: ${sk.bb.stun} s`);
|
||||
approx(hpAtEnd, hp0, `T${tier}: no trait heal during the slashes`);
|
||||
const bar = u.findBuff('skill:zuole:barrier3');
|
||||
approx(bar.shield, 21 * 70 * sk.bb.shield_scale, `T${tier}: 21 × 70 × ${sk.bb.shield_scale}`);
|
||||
approx(bar.timeLeft, 15, `T${tier}: 15 s`, 0.01);
|
||||
// afterwards the trait heals again; the barrier lasts 15 s from its last gain
|
||||
h.runUntil(() => hitsBy(h, u).some((c) => !c.dmg.isSkill), 3);
|
||||
assert.ok(u.hp > hp0, `T${tier}: the trait heals again`);
|
||||
h.run(15);
|
||||
assert.equal(u.findBuff('skill:zuole:barrier3'), null, `T${tier}: gone 15 s later`);
|
||||
done(h);
|
||||
}
|
||||
// the cap: 2× max HP at each gain; each gain restarts the 15 s
|
||||
const { h, u } = field({ tier: 6, elite: true, skill: 2 });
|
||||
noSp(h, u);
|
||||
h.b.addBuff(u, { key: 'skill:zuole:barrier3', shield: u.s.maxHp * 1.99, duration: 3, data: { createdAt: 0 } });
|
||||
u.skill.charges = 1;
|
||||
h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
h.step();
|
||||
const b = u.findBuff('skill:zuole:barrier3');
|
||||
approx(b.shield, u.s.maxHp * 2, 'capped at 2× max HP');
|
||||
approx(b.timeLeft, 15, 'restarted', 0.01);
|
||||
done(h);
|
||||
});
|
||||
|
||||
test('T1 秉烛照影 (坚忍): ASPD up to +50 and SP recovery up to +2/s, linear in the HP lost, full at 70 % lost — SBL-X stage 3: +70 / +2.3 at 50 % lost (stage 1: unchanged)', () => {
|
||||
for (const f of [[5, false, null], [6, true, null], [5, true, SBLX], [6, true, SBLX], [6, true, SBLY]]) {
|
||||
const [tier, elite, mod] = f;
|
||||
const x3 = tier === 6 && mod === SBLX;
|
||||
const [as, sp, full] = x3 ? [70, 2.3, 0.5] : [50, 2, 0.3];
|
||||
const { h, u } = field({ tier, elite, mod, skill: 2 });
|
||||
const t0 = u.def.raw.talents.find((t) => t.index === 0).bb;
|
||||
assert.deepEqual([t0.min_attack_speed, t0.min_sp_recovery_per_sec, t0.min_hp_ratio], [as, sp, full], label(f));
|
||||
assert.deepEqual([u.s.aspd, u.s.spRecovery], [100, 1], `${label(f)}: full HP`);
|
||||
for (const ratio of [0.8, 0.6, full, 0.1]) {
|
||||
u.hp = u.s.maxHp * ratio;
|
||||
h.step();
|
||||
const k = Math.min(1, (1 - ratio) / (1 - full));
|
||||
approx(u.s.aspd, 100 + as * k, `${label(f)}: ASPD at ${ratio * 100} %`);
|
||||
approx(u.s.spRecovery, 1 + sp * k, `${label(f)}: SP recovery at ${ratio * 100} %`);
|
||||
}
|
||||
u.hp = u.s.maxHp;
|
||||
h.step();
|
||||
assert.deepEqual([u.s.aspd, u.s.spRecovery], [100, 1], `${label(f)}: back at full HP`);
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('T2 守正自明: every damage he outputs rolls 20 % (70 % below half HP) for 1 SP — SBL-Y stage 3: 80 % below half and the instance ×1.2 on a success (stage 1: unchanged)', () => {
|
||||
for (const f of [[5, false, null], [5, true, SBLY], [6, true, SBLY]]) {
|
||||
const [tier, elite, mod] = f;
|
||||
const y3 = tier === 6 && mod === SBLY;
|
||||
const { h, u } = field({ tier, elite, mod, skill: 1, seed: 17 });
|
||||
const t1 = u.def.raw.talents.find((t) => t.index === 1).bb;
|
||||
assert.deepEqual([t1.prob_1, t1.prob_2, t1.hp_ratio, t1.sp, t1.atk_scale ?? 1], [0.2, y3 ? 0.8 : 0.7, 0.5, 1, y3 ? 1.2 : 1], label(f));
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
u.skill.spCostMul = 1e5; // the skill never fills: every success is an spGain of its own
|
||||
for (const [ratio, prob] of [[0.9, 0.2], [0.3, y3 ? 0.8 : 0.7]]) {
|
||||
let gains = 0, rolls = 0, boosted = 0;
|
||||
const offG = h.b.on('spGain', (c) => { if (c.unit === u && c.reason === 'talent') gains++; });
|
||||
const offD = h.b.on('damaged', (c) => {
|
||||
if (c.source !== u || c.target !== e) return;
|
||||
rolls++;
|
||||
if (Math.abs(c.amount - u.s.atk * 1.2) < 1e-6) boosted++;
|
||||
u.hp = u.s.maxHp * ratio; // keep the HP band
|
||||
});
|
||||
u.hp = u.s.maxHp * ratio;
|
||||
h.run(150);
|
||||
h.b.off(offG);
|
||||
h.b.off(offD);
|
||||
const rate = gains / rolls;
|
||||
assert.ok(Math.abs(rate - prob) < 0.08, `${label(f)} at ${ratio * 100} %: ${gains} / ${rolls} ≈ ${prob}`);
|
||||
assert.equal(boosted, y3 ? gains : 0, `${label(f)}: ×1.2 on each success`);
|
||||
}
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
|
||||
test('SBL-X (stages 1 and 3): 25 % 庇护 below 50 % HP — physical and arts, not true; none at or above 50 %; after 行险 the 庇护 comes back behind the barrier (it cuts only what passes it)', () => {
|
||||
for (const tier of [5, 6]) {
|
||||
const { h, u } = field({ tier, elite: true, mod: SBLX, skill: 1 });
|
||||
const t0 = u.def.raw.talents.find((t) => t.index === 0).bb;
|
||||
assert.deepEqual([t0.hp_ratio, t0.damage_resistance], [0.5, 0.25], `T${tier}`);
|
||||
noSp(h, u);
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
const take = (amount, type) => { const hp = u.hp; h.b.dealDamage(e, u, { amount, type }); return hp - u.hp; };
|
||||
u.hp = u.s.maxHp * 0.6;
|
||||
approx(take(300, 'true'), 300, `T${tier}: above 50 %: nothing`);
|
||||
u.hp = u.s.maxHp * 0.4;
|
||||
approx(take(1000, 'phys'), Math.max(1000 - u.s.def, 50) * 0.75, `T${tier}: physical ×0.75`);
|
||||
approx(take(400, 'arts'), 400 * 0.75, `T${tier}: arts ×0.75`);
|
||||
approx(take(400, 'true'), 400, `T${tier}: true untouched`);
|
||||
// 行险: 庇护 reset for 0.1 s, then judged again — after the barrier
|
||||
u.hp = u.s.maxHp * 0.8;
|
||||
let hpAtStart = null;
|
||||
h.b.on('skillStart', (c) => { if (c.unit === u && hpAtStart == null) hpAtStart = u.hp; });
|
||||
u.skill.charges = 1;
|
||||
assert.ok(h.runUntil(() => u.skill.active, 3));
|
||||
approx(hpAtStart, u.s.maxHp * 0.4, `T${tier}: −50 %`);
|
||||
const bar = u.findBuff('skill:zuole:barrier2');
|
||||
const B = bar.shield;
|
||||
approx(take(1000, 'true'), 0, `T${tier}: inside 0.1 s the barrier takes it whole`);
|
||||
approx(bar.shield, B - 1000, `T${tier}: no 庇护 inside the 0.1 s`);
|
||||
h.run(0.2);
|
||||
bar.shield = 500;
|
||||
const hp = u.hp;
|
||||
take(1300, 'arts');
|
||||
approx(bar.shield, 0, `T${tier}: the barrier took 500 of the full 1300`);
|
||||
approx(hp - u.hp, 800 * 0.75, `T${tier}: 庇护 cut the 800 that passed`);
|
||||
done(h);
|
||||
}
|
||||
// without the module: no 庇护
|
||||
const { h, u } = field({ tier: 6, elite: true, mod: SBLY, skill: 1 });
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
u.hp = u.s.maxHp * 0.3;
|
||||
const hp = u.hp;
|
||||
h.b.dealDamage(e, u, { amount: 400, type: 'arts' });
|
||||
approx(hp - u.hp, 400, 'SBL-Y: no 庇护');
|
||||
done(h);
|
||||
});
|
||||
|
||||
test('SBL-Y (stages 1 and 3): knocked out ⇒ he stays and heals 30 % max HP, once per deployment (again after a redeploy); not while a 不死 holds him; none without the module', () => {
|
||||
for (const tier of [5, 6]) {
|
||||
const { h, u } = field({ tier, elite: true, mod: SBLY, skill: 1 });
|
||||
assert.deepEqual(u.def.raw.trait.bb, { value: 70, hp_ratio: 0.3 }, `T${tier}`);
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
h.b.dealDamage(e, u, { amount: 1e6, type: 'true' });
|
||||
assert.ok(u.alive, `T${tier}: not withdrawn`);
|
||||
approx(u.hp, u.s.maxHp * 0.3, `T${tier}: 30 % max HP`);
|
||||
h.b.dealDamage(e, u, { amount: 1e6, type: 'true' });
|
||||
assert.ok(!u.alive, `T${tier}: once per deployment`);
|
||||
h.b.redeploy(u);
|
||||
h.step();
|
||||
h.b.dealDamage(e, u, { amount: 1e6, type: 'true' });
|
||||
assert.ok(u.alive, `T${tier}: again after the redeploy`);
|
||||
// a running 不死 (坚固维式重锤's window) keeps him up instead
|
||||
h.b.redeploy(u);
|
||||
const r = field({ tier, elite: true, mod: SBLY, skill: 1 });
|
||||
r.u.mem.undyingAt = `${r.u.deploySeq}:0`;
|
||||
r.u.mem.undyingUntil = r.h.b.time + 5;
|
||||
const hammer = r.h.b.on('fatal', (c) => { if (c.unit === r.u && !c.prevented) c.prevented = true; }, { priority: -99 });
|
||||
const f = r.h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
r.h.b.dealDamage(f, r.u, { amount: 1e6, type: 'true' });
|
||||
assert.ok(r.u.alive && r.u.hp < 2, `T${tier}: held by the 不死, the module untouched`);
|
||||
r.h.b.off(hammer);
|
||||
r.u.mem.undyingUntil = 0;
|
||||
r.h.b.dealDamage(f, r.u, { amount: 1e6, type: 'true' });
|
||||
assert.ok(r.u.alive, `T${tier}: the module still there afterwards`);
|
||||
approx(r.u.hp, r.u.s.maxHp * 0.3, `T${tier}: 30 % max HP`);
|
||||
done(h);
|
||||
done(r.h);
|
||||
}
|
||||
for (const mod of [null, SBLX]) {
|
||||
const { h, u } = field({ tier: 6, elite: true, mod, skill: 1 });
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 6] });
|
||||
h.b.dealDamage(e, u, { amount: 1e6, type: 'true' });
|
||||
assert.ok(!u.alive, `${mod ?? 'no module'}: withdrawn`);
|
||||
done(h);
|
||||
}
|
||||
});
|
||||
+364
-124
@@ -1309,129 +1309,129 @@
|
||||
"snaps": "10719944 a54473e5 586c12a4 e8572e94 cd658a5e 022bbca2 6875176a 88f39323 fe22255b b8659b38 b3436607 2bff9df5 448c5d3c bae393b0 7569d588 d5f887b5 1075cb4d 45d53303 6b53b401 8529d78b ee4d40ec"
|
||||
},
|
||||
"diy-033": {
|
||||
"about": "5_diy1_a=cdfend 5_diy2_b=cdfend 5_diy1_a=cguard 5_diy2_b=cguard 6_diy1_b=veen/S1 6_diy2_b=veen/S2 6_diy1_b=veen/S3 6_diy2_b=veen/S1/002_veen 6_diy1_b=veen/S2/002_veen 6_diy2_b=veen/S3/002_veen 5_diy1_a=csnipe 5_diy2_b=csnipe",
|
||||
"fast": true,
|
||||
"about": "5_diy1_a=zuole/S1 5_diy2_a=zuole/S2 5_diy1_a=zuole/S3 5_diy2_b=zuole/S1 5_diy1_b=zuole/S2 5_diy2_b=zuole/S3 6_diy1_b=veen/S1 6_diy2_b=veen/S2 6_diy1_b=veen/S3 6_diy2_b=veen/S1/002_veen 6_diy1_b=veen/S2/002_veen 6_diy2_b=veen/S3/002_veen",
|
||||
"fast": false,
|
||||
"kind": "normal",
|
||||
"stageId": "act2autochess_m04",
|
||||
"modeId": "mode_single_normal",
|
||||
"round": 13,
|
||||
"seed": 2802554051,
|
||||
"waveId": "act1autochess_h06",
|
||||
"time": 230,
|
||||
"ticks": 6900,
|
||||
"reason": "timeout",
|
||||
"killed": 59,
|
||||
"time": 220.4,
|
||||
"ticks": 6612,
|
||||
"reason": "cleared",
|
||||
"killed": 89,
|
||||
"total": 96,
|
||||
"unspawned": 0,
|
||||
"bossHpLeft": null,
|
||||
"rngDraws": 0,
|
||||
"rngDraws": 942,
|
||||
"errors": {"count":0,"kinds":[]},
|
||||
"players": {"p1":{"killed":59,"total":96,"perfect":false,"leaks":37,"leaksUncounted":0,"coins":0,"dmg":853050,"bossDmg":0,"heal":0,"deaths":11,"layerGains":{}}},
|
||||
"players": {"p1":{"killed":89,"total":96,"perfect":false,"leaks":7,"leaksUncounted":0,"coins":0,"dmg":1436069,"bossDmg":0,"heal":41700,"deaths":6,"layerGains":{}}},
|
||||
"units": [
|
||||
["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,108,0,912,6384,0,21,0],
|
||||
["p1",2,"op","chess_char_5_diy2_b",2,"none",0,0,115,0,2232,8724,0,24,1],
|
||||
["p1",3,"op","chess_char_5_diy1_a",2,null,2564,1,118,1,22685,5128,0,31,1],
|
||||
["p1",4,"op","chess_char_5_diy2_b",2,"none",0,0,117,3,27195,10002,0,35,1],
|
||||
["p1",5,"op","chess_char_6_diy1_b",0,"none",1404,1,3,11,86649,0,0,79,5],
|
||||
["p1",6,"op","chess_char_6_diy2_b",1,"none",1404,1,4,20,114352,0,0,94,3],
|
||||
["p1",7,"op","chess_char_6_diy1_b",2,"none",1404,1,11,2,84750,0,0,27,2],
|
||||
["p1",8,"op","chess_char_6_diy2_b",0,"uniequip_002_veen",1594,1,13,2,65860,0,0,18,5],
|
||||
["p1",9,"op","chess_char_6_diy1_b",1,"uniequip_002_veen",1594,1,5,13,145332,0,0,99,4],
|
||||
["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_veen",1594,1,10,5,200360,0,0,138,1],
|
||||
["p1",11,"op","chess_char_5_diy1_a",2,null,1271,1,12,0,40062,0,0,192,3],
|
||||
["p1",12,"op","chess_char_5_diy2_b",2,"none",1510,1,14,0,62659,0,0,190,3],
|
||||
["p1",1,"op","chess_char_5_diy1_a",0,null,0,0,75,8,33111,10336,4550,49,16],
|
||||
["p1",2,"op","chess_char_5_diy2_a",1,null,2706.5,1,100,3,108458,11017,7938,104,5],
|
||||
["p1",3,"op","chess_char_5_diy1_a",2,null,0,0,6,7,116137,7250,4357,76,7],
|
||||
["p1",4,"op","chess_char_5_diy2_b",0,"none",0,0,9,5,90240,11257,7724,72,33],
|
||||
["p1",5,"op","chess_char_5_diy1_b",1,"none",3533,1,113,10,143915,12955,9422,114,5],
|
||||
["p1",6,"op","chess_char_5_diy2_b",2,"none",3074.6,1,12,25,363768,8168,7709,166,10],
|
||||
["p1",7,"op","chess_char_6_diy1_b",0,"none",1404,1,3,0,0,0,0,0,5],
|
||||
["p1",8,"op","chess_char_6_diy2_b",1,"none",1404,1,4,8,129945,0,0,94,4],
|
||||
["p1",9,"op","chess_char_6_diy1_b",2,"none",1404,1,13,3,52108,0,0,21,2],
|
||||
["p1",10,"op","chess_char_6_diy2_b",0,"uniequip_002_veen",1594,1,14,0,64123,0,0,18,5],
|
||||
["p1",11,"op","chess_char_6_diy1_b",1,"uniequip_002_veen",1594,1,5,11,147344,0,0,96,4],
|
||||
["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_002_veen",394,1,11,9,186921,1200,0,142,1],
|
||||
["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null],
|
||||
["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null]
|
||||
],
|
||||
"enemies": {"enemy_1229_darmy":[27,19,8,1082,175575],"enemy_1229_darmy_2":[57,40,17,9636,509947],"enemy_9007_acelem":[12,0,11,19520,190361]},
|
||||
"hooks": [1,118,6900,975,975,3619,3644,0,70,106,29,27,55,34880,0,28,96,36,1,70,0,0,0],
|
||||
"events": {"atk":975,"deploy":20,"die":70,"dmg":3644,"fx":138,"leak":36,"skill":56,"spawn":110,"status":18},
|
||||
"fx": {"beam":10,"veenBounce":55,"veenVolley":73},
|
||||
"snaps": "a07829f2 3cf158b0 479435c7 27a9529c 96a9ad65 9d17fa2c 50b24bed 0fb108d6 9d492c99 ec0861cb a829d34a c0dd4419 990b0b71 cace0625 3408f7ff 4e21a576 c8ddbd12 63514ded f63b31be e6fa5bcd 041f97db ca21f4f6 983c1aa5"
|
||||
"enemies": {"enemy_1229_darmy":[27,26,1,4847,211170],"enemy_1229_darmy_2":[57,54,3,18063,574213],"enemy_9007_acelem":[12,9,3,27653,675207]},
|
||||
"hooks": [1,113,6612,1025,1025,3989,4048,900,95,102,97,91,41,38220,17,51,96,7,1,95,0,7,0],
|
||||
"events": {"atk":1067,"deploy":15,"die":95,"dmg":3811,"fx":130,"heal":562,"leak":7,"skill":188,"spawn":110,"status":122},
|
||||
"fx": {"aoe":17,"beam":13,"burst":7,"shield":10,"veenBounce":32,"veenVolley":51},
|
||||
"snaps": "1000ac84 bfde9768 1f819e49 25e96f05 1071a35f 0d9629ec 0e08d06a 77a2be9b ebe26002 bde5c83c bedfbfc2 179b6ff4 b13c3719 6597d5b8 bc5984ad 7b4f1f2d bf619f74 1e2b2581 1e5e1d7a 304459b5 35cd4f5c 86400373"
|
||||
},
|
||||
"diy-034": {
|
||||
"about": "5_diy1_a=acfend 5_diy2_b=acfend 5_diy1_a=acpion 5_diy2_b=acpion 5_diy1_a=acguad 5_diy2_b=acguad 5_diy1_a=ccast 5_diy2_b=ccast 5_diy1_a=cmedic 5_diy2_b=cmedic 5_diy1_a=csuppo 5_diy2_b=csuppo",
|
||||
"about": "5_diy1_b=zuole/S1/002_zuole 5_diy2_b=zuole/S2/002_zuole 5_diy1_b=zuole/S3/002_zuole 5_diy2_b=zuole/S1/003_zuole 5_diy1_b=zuole/S2/003_zuole 5_diy2_b=zuole/S3/003_zuole 6_diy1_a=zuole/S1 6_diy2_a=zuole/S2 6_diy1_a=zuole/S3 6_diy2_b=zuole/S1 6_diy1_b=zuole/S2 6_diy2_b=zuole/S3",
|
||||
"fast": false,
|
||||
"kind": "normal",
|
||||
"stageId": "act1autochess_m01",
|
||||
"modeId": "mode_multi_abyss",
|
||||
"round": 12,
|
||||
"round": 13,
|
||||
"seed": 1162087510,
|
||||
"waveId": "act1autochess_h05",
|
||||
"time": 206.8,
|
||||
"ticks": 6204,
|
||||
"reason": "cleared",
|
||||
"killed": 7,
|
||||
"total": 135,
|
||||
"waveId": "act1autochess_h06",
|
||||
"time": 230,
|
||||
"ticks": 6900,
|
||||
"reason": "timeout",
|
||||
"killed": 29,
|
||||
"total": 147,
|
||||
"unspawned": 0,
|
||||
"bossHpLeft": null,
|
||||
"rngDraws": 73,
|
||||
"rngDraws": 2625,
|
||||
"errors": {"count":0,"kinds":[]},
|
||||
"players": {"p1":{"killed":7,"total":135,"perfect":false,"leaks":128,"leaksUncounted":0,"coins":0,"dmg":532657,"bossDmg":0,"heal":31513,"deaths":17,"layerGains":{}}},
|
||||
"players": {"p1":{"killed":29,"total":147,"perfect":false,"leaks":118,"leaksUncounted":0,"coins":0,"dmg":1737717,"bossDmg":0,"heal":111569,"deaths":15,"layerGains":{}}},
|
||||
"units": [
|
||||
["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,107,1,4789,5208,0,27,0],
|
||||
["p1",2,"op","chess_char_5_diy2_b",2,"uniequip_002_acfend",0,0,124,0,12640,6742,0,39,2],
|
||||
["p1",3,"op","chess_char_5_diy1_a",2,null,0,0,151,0,38897,6450,0,23,1],
|
||||
["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acpion",0,0,100,1,230450,12913,0,47,4],
|
||||
["p1",5,"op","chess_char_5_diy1_a",2,null,1707.81,1,127,2,58554,13912,0,65,2],
|
||||
["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acguad",0,0,129,2,53451,6822,0,31,2],
|
||||
["p1",7,"op","chess_char_5_diy1_a",2,null,0,0,4,1,31054,1133,0,78,2],
|
||||
["p1",8,"op","chess_char_5_diy2_b",2,"none",1360,1,158,0,40022,1360,0,85,2],
|
||||
["p1",9,"op","chess_char_5_diy1_a",2,null,0,0,11,0,0,4772,14398,36,3],
|
||||
["p1",10,"op","chess_char_5_diy2_b",2,"none",1021.64,1,13,0,0,4000,17115,38,3],
|
||||
["p1",11,"op","chess_char_5_diy1_a",2,null,0,0,116,0,17420,1864,0,52,2],
|
||||
["p1",12,"op","chess_char_5_diy2_b",2,"none",1131,1,14,0,45379,3000,0,120,3],
|
||||
["p1",1,"op","chess_char_5_diy1_b",0,"uniequip_002_zuole",1841.53,1,132,7,217544,26224,21000,140,97],
|
||||
["p1",2,"op","chess_char_5_diy2_b",1,"uniequip_002_zuole",0,0,152,0,61103,11896,4830,46,3],
|
||||
["p1",3,"op","chess_char_5_diy1_b",2,"uniequip_002_zuole",3135.08,1,10,7,302585,7114,6716,173,12],
|
||||
["p1",4,"op","chess_char_5_diy2_b",0,"uniequip_003_zuole",1360.01,1,166,1,72299,21076,15920,101,68],
|
||||
["p1",5,"op","chess_char_5_diy1_b",1,"uniequip_003_zuole",0,0,103,2,146429,18218,11330,84,4],
|
||||
["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_003_zuole",0,0,6,4,352635,16360,13662,192,19],
|
||||
["p1",7,"op","chess_char_6_diy1_a",0,null,983.46,1,170,0,12377,9913,5110,49,22],
|
||||
["p1",8,"op","chess_char_6_diy2_a",1,null,0,0,110,0,14164,8236,2450,27,2],
|
||||
["p1",9,"op","chess_char_6_diy1_a",2,null,0,0,8,3,129073,11328,8435,132,12],
|
||||
["p1",10,"op","chess_char_6_diy2_b",0,"none",0,0,101,0,5653,12386,5320,33,26],
|
||||
["p1",11,"op","chess_char_6_diy1_b",1,"none",0,0,100,2,105473,13856,6790,65,3],
|
||||
["p1",12,"op","chess_char_6_diy2_b",2,"none",2533.39,1,15,3,318381,11006,10006,188,15],
|
||||
["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null],
|
||||
["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null],
|
||||
["-","~3","device","trap_1105_accrate",null,null,100,1,3,0,0,0,0,0,null]
|
||||
],
|
||||
"enemies": {"enemy_1148_dssbr":[63,4,59,20340,257178],"enemy_1148_dssbr_2":[60,3,57,21428,223440],"enemy_1439_dslntf":[12,0,12,26407,52039]},
|
||||
"hooks": [1,159,6204,888,888,1168,2159,74,24,152,26,25,0,27105,210,67,135,128,1,24,0,39,21],
|
||||
"events": {"atk":888,"deploy":21,"die":24,"dmg":2159,"fx":119,"heal":74,"leak":128,"skill":51,"spawn":150,"status":516},
|
||||
"fx": {"aoe":13,"burst":39,"dodge":21,"dp":6,"slash":40},
|
||||
"snaps": "8c950172 84292247 66bb7644 57694e16 77300d65 0485e386 b1644dc3 9fd8e152 ae38532d acf85cfd 6416e99b 150194af 384bffbd da563864 d3c6a232 e79c9e9f 752e3a91 4b57e564 3328cd07 f5dbb08c 0d910b50"
|
||||
"enemies": {"enemy_1166_dusbr_2":[39,20,19,40402,659130],"enemy_1169_duphlx_2":[57,8,47,60703,754895],"enemy_1170_dushld_2":[51,1,50,55427,323691]},
|
||||
"hooks": [1,170,6900,1717,1717,3112,3124,2514,44,160,283,283,0,37911,127,55,147,116,1,48,0,0,0],
|
||||
"events": {"atk":1832,"deploy":20,"die":44,"dmg":2904,"fx":74,"heal":1427,"leak":116,"skill":566,"spawn":162,"status":473},
|
||||
"fx": {"aoe":58,"revive":4,"shield":12},
|
||||
"snaps": "c1b566a5 fde7175b e5771726 b555c511 d14ece62 4f0bddb1 bb49d82b 2af32cbf 59449b40 68887607 7ada4944 9e308e01 1c704504 710da9ea 9dade500 2b7a285d 59e9ccbe b858f755 afe523d6 06a23765 516992f3 96d52da5 8e55f916"
|
||||
},
|
||||
"diy-035": {
|
||||
"about": "5_diy1_a=sharp2 5_diy2_b=sharp2 5_diy1_a=acspec 5_diy2_b=acspec 5_diy1_a=acnipe 5_diy2_b=acnipe 5_diy1_a=accast 5_diy2_b=accast 5_diy1_a=acmedc 5_diy2_b=acmedc 5_diy1_a=acsupo 5_diy2_b=acsupo",
|
||||
"about": "6_diy1_b=zuole/S1/002_zuole 6_diy2_b=zuole/S2/002_zuole 6_diy1_b=zuole/S3/002_zuole 6_diy2_b=zuole/S1/003_zuole 6_diy1_b=zuole/S2/003_zuole 6_diy2_b=zuole/S3/003_zuole 5_diy1_a=chyue/S1 5_diy2_a=chyue/S2 5_diy1_a=chyue/S3 5_diy2_b=chyue/S1 5_diy1_b=chyue/S2 5_diy2_b=chyue/S3",
|
||||
"fast": false,
|
||||
"kind": "normal",
|
||||
"stageId": "act1autochess_m02",
|
||||
"modeId": "mode_multi_funny",
|
||||
"round": 12,
|
||||
"round": 13,
|
||||
"seed": 4056308894,
|
||||
"waveId": "act1autochess_h05",
|
||||
"time": 202.73,
|
||||
"ticks": 6082,
|
||||
"waveId": "act1autochess_h06",
|
||||
"time": 216.63,
|
||||
"ticks": 6499,
|
||||
"reason": "cleared",
|
||||
"killed": 87,
|
||||
"total": 99,
|
||||
"killed": 45,
|
||||
"total": 150,
|
||||
"unspawned": 0,
|
||||
"bossHpLeft": null,
|
||||
"rngDraws": 1043,
|
||||
"rngDraws": 833,
|
||||
"errors": {"count":0,"kinds":[]},
|
||||
"players": {"p1":{"killed":87,"total":99,"perfect":false,"leaks":12,"leaksUncounted":0,"coins":0,"dmg":702906,"bossDmg":0,"heal":55399,"deaths":3,"layerGains":{}}},
|
||||
"players": {"p1":{"killed":45,"total":150,"perfect":false,"leaks":105,"leaksUncounted":0,"coins":0,"dmg":276367,"bossDmg":0,"heal":23776,"deaths":8,"layerGains":{}}},
|
||||
"units": [
|
||||
["p1",1,"op","chess_char_5_diy1_a",0,null,535.6,1,3,20,91921,1329,0,125,3],
|
||||
["p1",2,"op","chess_char_5_diy2_b",0,"uniequip_002_sharp2",2374,1,1,6,64041,0,0,60,3],
|
||||
["p1",3,"op","chess_char_5_diy1_a",2,null,311,1,4,1,2114,843,0,24,0],
|
||||
["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acspec",1218,1,75,1,8828,2132,0,35,0],
|
||||
["p1",5,"op","chess_char_5_diy1_a",2,null,1272,1,5,11,85301,0,0,201,2],
|
||||
["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acnipe",1587,1,8,23,178332,0,0,186,2],
|
||||
["p1",7,"op","chess_char_5_diy1_a",2,null,1372,1,6,0,18491,0,0,17,2],
|
||||
["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_accast",1749,1,9,21,192348,0,0,77,2],
|
||||
["p1",9,"op","chess_char_5_diy1_a",2,null,0,0,10,0,0,16500,27423,53,2],
|
||||
["p1",10,"op","chess_char_5_diy2_b",2,"uniequip_002_acmedc",1021,1,11,0,0,15939,27976,69,3],
|
||||
["p1",11,"op","chess_char_5_diy1_a",2,null,0,0,12,4,30977,25283,0,109,3],
|
||||
["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acsupo",1430,1,2,0,30553,0,0,54,2]
|
||||
["p1",1,"op","chess_char_6_diy1_b",0,"uniequip_002_zuole",2963.8,1,4,7,41736,14420,13851,184,72],
|
||||
["p1",2,"op","chess_char_6_diy2_b",1,"uniequip_002_zuole",3533,1,1,0,0,0,0,0,0],
|
||||
["p1",3,"op","chess_char_6_diy1_b",2,"uniequip_002_zuole",3533,1,5,2,16194,0,0,0,5],
|
||||
["p1",4,"op","chess_char_6_diy2_b",0,"uniequip_003_zuole",3913,1,6,0,0,0,0,0,0],
|
||||
["p1",5,"op","chess_char_6_diy1_b",1,"uniequip_003_zuole",1985.94,1,7,4,32338,8927,7000,100,7],
|
||||
["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_003_zuole",3913,1,9,14,82906,2924,2924,118,8],
|
||||
["p1",7,"op","chess_char_5_diy1_a",0,null,0,0,99,3,15179,4320,0,93,16],
|
||||
["p1",8,"op","chess_char_5_diy2_a",1,null,2160,1,2,0,0,0,0,0,0],
|
||||
["p1",9,"op","chess_char_5_diy1_a",2,null,2160,1,3,0,0,0,0,0,0],
|
||||
["p1",10,"op","chess_char_5_diy2_b",0,"none",0,0,111,4,21886,4950,0,89,19],
|
||||
["p1",11,"op","chess_char_5_diy1_b",1,"none",0,0,105,11,52677,4950,0,90,10],
|
||||
["p1",12,"op","chess_char_5_diy2_b",2,"none",2475,1,167,0,13451,4950,0,72,6]
|
||||
],
|
||||
"enemies": {"enemy_1010_demon":[42,41,1,54506,296286],"enemy_1320_wdrrl_2":[12,2,10,0,173583],"enemy_1422_lrsldr_2":[45,44,1,7520,233038]},
|
||||
"hooks": [1,112,6082,1234,1234,1797,1860,205,90,102,24,23,0,34456,6724,33,99,12,1,90,0,0,0],
|
||||
"events": {"atk":1488,"deploy":13,"die":90,"dmg":1859,"fx":32,"heal":158,"leak":12,"skill":46,"spawn":111,"status":624},
|
||||
"fx": {"aoe":14,"displace":1,"dodge":16,"spGain":1},
|
||||
"snaps": "9b12b5a2 9008ef38 d758917c a78c501f 8e5be89d 9d1491a1 be80716d ba16422b 24993631 17f367e0 5eb39615 1d861ce1 e35e2e74 f401a47c 00eb08a9 77c341e2 708eb8a2 328fa66d 2cc731ce c77d68c6 d21e342c"
|
||||
"enemies": {"enemy_1249_lysdb_2":[60,23,37,4625,134112],"enemy_1251_lysyta":[51,13,38,109,45084],"enemy_1329_cbshld":[39,9,30,31844,97171]},
|
||||
"hooks": [1,167,6499,955,955,1155,1133,541,53,158,143,143,0,22797,15,46,150,105,1,53,0,0,0],
|
||||
"events": {"atk":955,"deploy":17,"die":53,"dmg":1101,"fx":63,"heal":343,"leak":105,"skill":286,"spawn":162,"status":63},
|
||||
"fx": {"aoe":27,"shield":7,"shieldBreak":29},
|
||||
"snaps": "9dd48aeb 768b6a62 67283489 1675f039 1f8fdd77 d21f5954 aa91e08a c2060be1 44623a43 bd545014 c169ebe7 352eb9fb d7840395 5ed9b33e bd4ea4fd aec07aa7 ff0367f3 4573ca99 2da154c2 258f245a 99df514b 22a7e2c8"
|
||||
},
|
||||
"diy-036": {
|
||||
"about": "6_diy1_a=acfend 6_diy2_b=acfend 6_diy1_a=acpion 6_diy2_b=acpion 6_diy1_a=acguad 6_diy2_b=acguad 6_diy1_a=acnipe 6_diy2_b=acnipe 6_diy1_a=accast 6_diy2_b=accast 6_diy1_a=acmedc 6_diy2_b=acmedc",
|
||||
"about": "5_diy1_b=chyue/S1/002_chyue 5_diy2_b=chyue/S2/002_chyue 5_diy1_b=chyue/S3/002_chyue 5_diy2_b=chyue/S1/003_chyue 5_diy1_b=chyue/S2/003_chyue 5_diy2_b=chyue/S3/003_chyue 6_diy1_a=chyue/S1 6_diy2_a=chyue/S2 6_diy1_a=chyue/S3 6_diy2_b=chyue/S1 6_diy1_b=chyue/S2 6_diy2_b=chyue/S3",
|
||||
"fast": false,
|
||||
"kind": "normal",
|
||||
"stageId": "act1autochess_m03",
|
||||
@@ -1439,48 +1439,47 @@
|
||||
"round": 13,
|
||||
"seed": 2415735691,
|
||||
"waveId": "act1autochess_h06",
|
||||
"time": 202.87,
|
||||
"ticks": 6086,
|
||||
"time": 200,
|
||||
"ticks": 6000,
|
||||
"reason": "cleared",
|
||||
"killed": 192,
|
||||
"total": 266,
|
||||
"killed": 99,
|
||||
"total": 188,
|
||||
"unspawned": 0,
|
||||
"bossHpLeft": null,
|
||||
"rngDraws": 239,
|
||||
"rngDraws": 355,
|
||||
"errors": {"count":0,"kinds":[]},
|
||||
"players": {"p1":{"killed":192,"total":266,"perfect":false,"leaks":74,"leaksUncounted":0,"coins":0,"dmg":435875,"bossDmg":0,"heal":48672,"deaths":10,"layerGains":{}}},
|
||||
"players": {"p1":{"killed":99,"total":188,"perfect":false,"leaks":89,"leaksUncounted":0,"coins":0,"dmg":152100,"bossDmg":0,"heal":0,"deaths":25,"layerGains":{}}},
|
||||
"units": [
|
||||
["p1",1,"op","chess_char_6_diy1_a",2,null,0,0,227,4,3127,5208,0,22,1],
|
||||
["p1",2,"op","chess_char_6_diy2_b",2,"uniequip_002_acfend",3431,1,246,8,15036,12560,0,71,2],
|
||||
["p1",3,"op","chess_char_6_diy1_a",2,null,1529,1,234,24,18577,4001,0,25,3],
|
||||
["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acpion",1904,1,239,25,18823,4924,0,33,3],
|
||||
["p1",5,"op","chess_char_6_diy1_a",2,null,2638,1,163,13,46706,20174,0,77,3],
|
||||
["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acguad",3531,1,228,14,103845,18923,0,84,3],
|
||||
["p1",7,"op","chess_char_6_diy1_a",2,null,1272,1,8,6,3432,0,0,27,1],
|
||||
["p1",8,"op","chess_char_6_diy2_b",2,"uniequip_002_acnipe",1643,1,12,18,30557,0,0,64,2],
|
||||
["p1",9,"op","chess_char_6_diy1_a",2,null,1372,1,14,0,17500,0,0,23,1],
|
||||
["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_accast",1819,1,4,80,178273,0,0,72,2],
|
||||
["p1",11,"op","chess_char_6_diy1_a",2,null,1224,1,6,0,0,0,25511,56,2],
|
||||
["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_002_acmedc",1464,1,154,0,0,6020,23161,35,2],
|
||||
["p1",1,"op","chess_char_5_diy1_b",0,"uniequip_002_chyue",2685,1,212,4,10315,5370,0,25,4],
|
||||
["p1",2,"op","chess_char_5_diy2_b",1,"uniequip_002_chyue",0,0,174,3,13525,8055,0,23,3],
|
||||
["p1",3,"op","chess_char_5_diy1_b",2,"uniequip_002_chyue",2594.23,1,169,14,8655,5461,0,39,3],
|
||||
["p1",4,"op","chess_char_5_diy2_b",0,"uniequip_003_chyue",2475,1,192,16,11626,4950,0,52,10],
|
||||
["p1",5,"op","chess_char_5_diy1_b",1,"uniequip_003_chyue",2475,1,222,3,3663,4950,0,14,2],
|
||||
["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_003_chyue",2289.35,1,172,15,26054,5136,0,68,5],
|
||||
["p1",7,"op","chess_char_6_diy1_a",0,null,601.66,1,175,14,36530,5878,0,73,14],
|
||||
["p1",8,"op","chess_char_6_diy2_a",1,null,0,0,120,8,2043,4320,0,28,7],
|
||||
["p1",9,"op","chess_char_6_diy1_a",2,null,0,0,113,10,3519,4320,0,45,3],
|
||||
["p1",10,"op","chess_char_6_diy2_b",0,"none",0,0,111,9,30011,4950,0,54,11],
|
||||
["p1",11,"op","chess_char_6_diy1_b",1,"none",0,0,125,3,5720,4950,0,14,10],
|
||||
["p1",12,"op","chess_char_6_diy2_b",2,"none",0,0,132,0,440,4950,0,14,0],
|
||||
["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null],
|
||||
["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null],
|
||||
["-","~3","device","trap_1105_accrate",null,null,100,1,3,0,0,0,0,0,null]
|
||||
],
|
||||
"enemies": {
|
||||
"enemy_1195_sfyin": [39,25,14,2609,109226],
|
||||
"enemy_1196_msfyin": [50,39,11,0,85],
|
||||
"enemy_1197_sfshu": [48,37,11,8745,174749],
|
||||
"enemy_1198_msfshu": [111,85,26,0,287],
|
||||
"enemy_1207_sfji": [12,6,6,60456,151454],
|
||||
"enemy_1208_msfji": [6,0,6,0,74]
|
||||
"enemy_1195_sfyin": [39,16,23,1066,53084],
|
||||
"enemy_1196_msfyin": [32,21,11,0,44],
|
||||
"enemy_1197_sfshu": [48,19,29,2476,78797],
|
||||
"enemy_1198_msfshu": [57,43,14,0,132],
|
||||
"enemy_1207_sfji": [12,0,12,59748,20043]
|
||||
},
|
||||
"hooks": [1,290,6086,856,856,1375,1336,160,202,276,25,25,0,31178,0,63,266,74,1,207,0,0,39],
|
||||
"events": {"atk":922,"deploy":21,"die":202,"dmg":1336,"fx":264,"heal":141,"leak":74,"skill":50,"spawn":281,"status":32},
|
||||
"fx": {"aoe":53,"dodge":39,"dp":55,"slash":40,"spGain":9,"summon":68},
|
||||
"snaps": "74c08ab0 d7fae2c7 e5fc0721 098ca8da 386839f8 1014e7e2 5b3f511c cae02b78 6c9c4314 3ef337b7 19e2c676 b3eebb59 5c2a3715 354e546e 6ca7ab30 6153fdd2 dc92916e 069961c0 9b27edc4 4c63bb80 c4485363"
|
||||
"hooks": [1,222,6000,599,599,645,642,0,124,213,72,72,0,7162,0,58,188,89,1,124,0,0,3],
|
||||
"events": {"atk":599,"deploy":31,"die":124,"dmg":642,"fx":60,"leak":89,"skill":144,"spawn":203,"status":18},
|
||||
"fx": {"aoe":22,"dodge":3,"summon":35},
|
||||
"snaps": "6b4e2791 428cc45f 73f71979 705fe1cc 88c45f49 10171942 ef3dcebe 7bd24710 ead572e7 7e986c1b 51582fa7 7a4788b2 c09ac907 c766ca8c e7aee44a d342840a 0c03efa0 df3009e6 7e7ff8fa bf670d42"
|
||||
},
|
||||
"diy-037": {
|
||||
"about": "6_diy1_a=sharp2 6_diy2_b=sharp2 6_diy1_a=acspec 6_diy2_b=acspec 6_diy1_a=acsupo 6_diy2_b=acsupo",
|
||||
"about": "5_diy1_a=huang/S1 5_diy2_a=huang/S2 5_diy1_a=huang/S3 5_diy2_b=huang/S1 5_diy1_b=huang/S2 5_diy2_b=huang/S3 6_diy1_b=chyue/S1/002_chyue 6_diy2_b=chyue/S2/002_chyue 6_diy1_b=chyue/S3/002_chyue 6_diy2_b=chyue/S1/003_chyue 6_diy1_b=chyue/S2/003_chyue 6_diy2_b=chyue/S3/003_chyue",
|
||||
"fast": false,
|
||||
"kind": "normal",
|
||||
"stageId": "act1autochess_m04",
|
||||
@@ -1488,32 +1487,273 @@
|
||||
"round": 13,
|
||||
"seed": 775009396,
|
||||
"waveId": "act1autochess_h06",
|
||||
"time": 213.43,
|
||||
"ticks": 6403,
|
||||
"time": 205.67,
|
||||
"ticks": 6170,
|
||||
"reason": "cleared",
|
||||
"killed": 8,
|
||||
"killed": 11,
|
||||
"total": 114,
|
||||
"unspawned": 0,
|
||||
"bossHpLeft": null,
|
||||
"rngDraws": 217,
|
||||
"rngDraws": 349,
|
||||
"errors": {"count":0,"kinds":[]},
|
||||
"players": {"p1":{"killed":8,"total":114,"perfect":false,"leaks":106,"leaksUncounted":0,"coins":0,"dmg":372337,"bossDmg":0,"heal":0,"deaths":22,"layerGains":{}}},
|
||||
"players": {"p1":{"killed":11,"total":114,"perfect":false,"leaks":103,"leaksUncounted":0,"coins":0,"dmg":416242,"bossDmg":0,"heal":11745,"deaths":22,"layerGains":{}}},
|
||||
"units": [
|
||||
["p1",1,"op","chess_char_6_diy1_a",0,null,0,0,140,0,29075,5595,0,27,1],
|
||||
["p1",2,"op","chess_char_6_diy2_b",0,"uniequip_002_sharp2",0,0,92,4,105718,4988,0,41,1],
|
||||
["p1",3,"op","chess_char_6_diy1_a",2,null,0,0,139,0,26275,10386,0,34,0],
|
||||
["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acspec",0,0,141,0,56947,11872,0,72,0],
|
||||
["p1",5,"op","chess_char_6_diy1_a",2,null,1160,1,4,3,62257,0,0,139,2],
|
||||
["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acsupo",1450,1,5,1,92065,0,0,150,3],
|
||||
["p1",1,"op","chess_char_5_diy1_a",0,null,0,0,110,0,11437,6345,2115,18,3],
|
||||
["p1",2,"op","chess_char_5_diy2_a",1,null,0,0,126,0,9489,6345,2115,19,0],
|
||||
["p1",3,"op","chess_char_5_diy1_a",2,null,0,0,7,2,41105,3173,1058,1,1],
|
||||
["p1",4,"op","chess_char_5_diy2_b",0,"none",0,0,9,1,15699,3875,1292,10,2],
|
||||
["p1",5,"op","chess_char_5_diy1_b",1,"none",0,0,85,2,34377,7749,2583,30,0],
|
||||
["p1",6,"op","chess_char_5_diy2_b",2,"none",0,0,83,2,84160,7749,2583,20,1],
|
||||
["p1",7,"op","chess_char_6_diy1_b",0,"uniequip_002_chyue",2735,1,143,1,36892,5470,0,60,13],
|
||||
["p1",8,"op","chess_char_6_diy2_b",1,"uniequip_002_chyue",1482.05,1,140,1,74619,6723,0,76,8],
|
||||
["p1",9,"op","chess_char_6_diy1_b",2,"uniequip_002_chyue",0,0,97,0,14408,5470,0,36,2],
|
||||
["p1",10,"op","chess_char_6_diy2_b",0,"uniequip_003_chyue",2475,1,142,1,14023,4950,0,33,6],
|
||||
["p1",11,"op","chess_char_6_diy1_b",1,"uniequip_003_chyue",515,1,134,1,52411,6910,0,35,6],
|
||||
["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_003_chyue",0,0,80,0,27623,4950,0,64,5],
|
||||
["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null],
|
||||
["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null],
|
||||
["-","~3","device","trap_1105_accrate",null,null,100,1,3,0,0,0,0,0,null]
|
||||
],
|
||||
"enemies": {"enemy_1381_winman":[27,5,22,5454,142346],"enemy_1381_winman_2":[48,3,45,5428,226363],"enemy_1387_winshd":[39,0,39,21959,171306]},
|
||||
"hooks": [1,141,6403,576,576,3039,3101,0,30,136,7,23,0,10542,12614,31,114,106,1,30,0,0,0],
|
||||
"events": {"atk":611,"deploy":24,"die":30,"dmg":2992,"fx":37,"leak":106,"skill":13,"spawn":123,"status":800},
|
||||
"fx": {"displace":27,"dodge":10},
|
||||
"snaps": "e840ece4 d3471b55 e3a6dada 611a7964 e06281b6 bd53a023 022502fe eddd554d 18dcff13 eb023c12 11b5046a b199b58b 0db4afa9 bc8a6002 65d5bf21 87a25c0c eed04c57 554a7c10 fdd40ba4 9fbc3909 521a5144 3a7d6770"
|
||||
"enemies": {"enemy_1381_winman":[27,6,21,4286,132326],"enemy_1381_winman_2":[48,5,43,30302,269426],"enemy_1387_winshd":[39,0,39,26648,145880]},
|
||||
"hooks": [1,143,6170,686,686,3001,2991,10,33,136,47,47,0,9690,13,55,114,103,1,33,0,0,12],
|
||||
"events": {"atk":812,"deploy":26,"die":33,"dmg":2911,"fx":60,"heal":10,"leak":103,"skill":94,"spawn":129,"status":30},
|
||||
"fx": {"aoe":38,"dodge":12,"heal":10},
|
||||
"snaps": "a9f4519d 1ad3f879 a31119e8 efe43dc2 efbe0f2c 6a981e55 4933de26 5fbc3d89 5cb5cb0f 0da91bd0 7f738e01 c04ed1d2 d268f7ab 9a0775ec bb28285b 8665972d 54ae3ad9 2b32d90e da6e4d45 1191e49c 0a4e359f"
|
||||
},
|
||||
"diy-038": {
|
||||
"about": "5_diy1_b=huang/S1/002_huang 5_diy2_b=huang/S2/002_huang 5_diy1_b=huang/S3/002_huang 5_diy2_b=huang/S1/003_huang 5_diy1_b=huang/S2/003_huang 5_diy2_b=huang/S3/003_huang 6_diy1_a=huang/S1 6_diy2_a=huang/S2 6_diy1_a=huang/S3 6_diy2_b=huang/S1 6_diy1_b=huang/S2 6_diy2_b=huang/S3",
|
||||
"fast": false,
|
||||
"kind": "normal",
|
||||
"stageId": "act1autochess_m05",
|
||||
"modeId": "mode_multi_hard",
|
||||
"round": 13,
|
||||
"seed": 3429784802,
|
||||
"waveId": "act1autochess_h06",
|
||||
"time": 230,
|
||||
"ticks": 6900,
|
||||
"reason": "timeout",
|
||||
"killed": 4,
|
||||
"total": 105,
|
||||
"unspawned": 0,
|
||||
"bossHpLeft": null,
|
||||
"rngDraws": 0,
|
||||
"errors": {"count":0,"kinds":[]},
|
||||
"players": {"p1":{"killed":4,"total":105,"perfect":false,"leaks":101,"leaksUncounted":0,"coins":0,"dmg":287061,"bossDmg":0,"heal":23378,"deaths":17,"layerGains":{}}},
|
||||
"units": [
|
||||
["p1",1,"op","chess_char_5_diy1_b",0,"uniequip_002_huang",2823,1,127,2,30353,8469,2823,19,2],
|
||||
["p1",2,"op","chess_char_5_diy2_b",1,"uniequip_002_huang",0,0,111,1,23855,8469,2823,19,0],
|
||||
["p1",3,"op","chess_char_5_diy1_b",2,"uniequip_002_huang",0,0,126,0,130746,12704,4235,23,1],
|
||||
["p1",4,"op","chess_char_5_diy2_b",0,"uniequip_003_huang",0,0,76,0,34117,8649,2883,23,2],
|
||||
["p1",5,"op","chess_char_5_diy1_b",1,"uniequip_003_huang",0,0,122,0,36808,12974,4325,28,0],
|
||||
["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_003_huang",0,0,69,0,19137,8649,2883,15,0],
|
||||
["p1",7,"op","chess_char_6_diy1_a",0,null,0,0,65,0,12045,6345,2115,15,1],
|
||||
["p1",8,"op","chess_char_6_diy2_a",1,null,2115,1,1,0,0,0,0,0,1],
|
||||
["p1",9,"op","chess_char_6_diy1_a",2,null,2115,1,3,0,0,0,0,0,0],
|
||||
["p1",10,"op","chess_char_6_diy2_b",0,"none",2583,1,5,0,0,0,0,0,0],
|
||||
["p1",11,"op","chess_char_6_diy1_b",1,"none",2583,1,7,0,0,0,0,0,1],
|
||||
["p1",12,"op","chess_char_6_diy2_b",2,"none",0,0,9,0,0,3875,1292,0,0]
|
||||
],
|
||||
"enemies": {"enemy_1229_darmy":[27,4,23,5611,95073],"enemy_1229_darmy_2":[57,0,56,25726,193587],"enemy_1275_dwlock_2":[21,0,21,38090,90346]},
|
||||
"hooks": [1,127,6900,286,286,3016,3089,17,21,121,8,6,0,10285,11,51,105,100,1,21,0,16,0],
|
||||
"events": {"atk":498,"deploy":22,"die":21,"dmg":2927,"fx":92,"heal":17,"leak":100,"skill":14,"spawn":117,"status":52},
|
||||
"fx": {"aoe":9,"beam":45,"buff":2,"burst":16,"explode":3,"heal":17},
|
||||
"snaps": "08ec0e9b d4419c45 56a2bcb4 9e752221 efa858fd 0b8e0f61 07fd1174 33d5625e 3bcffa82 6bdfc54a 70fb78b8 6b78ec10 bb3a00e7 79fe9836 bfc1fad7 93de838f 3b2411a2 2abcc04e 5ed202f1 f86b9678 44fac894 5dffdeda 38dc3675"
|
||||
},
|
||||
"diy-039": {
|
||||
"about": "6_diy1_b=huang/S1/002_huang 6_diy2_b=huang/S2/002_huang 6_diy1_b=huang/S3/002_huang 6_diy2_b=huang/S1/003_huang 6_diy1_b=huang/S2/003_huang 6_diy2_b=huang/S3/003_huang 5_diy1_a=cdfend 5_diy2_b=cdfend 5_diy1_a=cguard 5_diy2_b=cguard 5_diy1_a=csnipe 5_diy2_b=csnipe",
|
||||
"fast": true,
|
||||
"kind": "normal",
|
||||
"stageId": "act1autochess_m06",
|
||||
"modeId": "mode_single_normal",
|
||||
"round": 13,
|
||||
"seed": 1549362176,
|
||||
"waveId": "act1autochess_h06",
|
||||
"time": 221.33,
|
||||
"ticks": 6640,
|
||||
"reason": "cleared",
|
||||
"killed": 27,
|
||||
"total": 132,
|
||||
"unspawned": 0,
|
||||
"bossHpLeft": null,
|
||||
"rngDraws": 0,
|
||||
"errors": {"count":0,"kinds":[]},
|
||||
"players": {"p1":{"killed":27,"total":132,"perfect":false,"leaks":105,"leaksUncounted":0,"coins":0,"dmg":272890,"bossDmg":0,"heal":23304,"deaths":22,"layerGains":{}}},
|
||||
"units": [
|
||||
["p1",1,"op","chess_char_6_diy1_b",0,"uniequip_002_huang",0,0,2,5,52981,4302,1434,24,6],
|
||||
["p1",2,"op","chess_char_6_diy2_b",1,"uniequip_002_huang",0,0,7,0,0,4302,1434,0,1],
|
||||
["p1",3,"op","chess_char_6_diy1_b",2,"uniequip_002_huang",0,0,111,0,0,8604,2868,0,0],
|
||||
["p1",4,"op","chess_char_6_diy2_b",0,"uniequip_003_huang",0,0,86,5,74003,11712,5856,36,9],
|
||||
["p1",5,"op","chess_char_6_diy1_b",1,"uniequip_003_huang",0,0,128,3,25035,11712,5856,33,0],
|
||||
["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_003_huang",0,0,98,6,52825,11712,5856,24,2],
|
||||
["p1",7,"op","chess_char_5_diy1_a",2,null,979,1,153,1,2665,5405,0,20,0],
|
||||
["p1",8,"op","chess_char_5_diy2_b",2,"none",0,0,4,0,4712,2908,0,38,1],
|
||||
["p1",9,"op","chess_char_5_diy1_a",2,null,0,0,155,1,15620,7692,0,22,1],
|
||||
["p1",10,"op","chess_char_5_diy2_b",2,"none",0,0,143,0,2653,6668,0,2,1],
|
||||
["p1",11,"op","chess_char_5_diy1_a",2,null,0,0,136,2,17302,2542,0,63,1],
|
||||
["p1",12,"op","chess_char_5_diy2_b",2,"none",1510,1,156,4,25093,3020,0,70,1]
|
||||
],
|
||||
"enemies": {"enemy_1019_jshoot_2":[57,15,42,6830,79336],"enemy_1381_winman":[27,9,18,2379,101941],"enemy_1389_winbab_2":[48,3,45,70638,91612]},
|
||||
"hooks": [1,156,6640,1321,1321,1459,1460,16,49,154,23,23,0,15923,9,56,132,105,1,49,0,0,0],
|
||||
"events": {"atk":1462,"deploy":24,"die":49,"dmg":954,"fx":30,"heal":16,"leak":105,"skill":46,"spawn":144,"status":22},
|
||||
"fx": {"aoe":13,"buff":1,"heal":16},
|
||||
"snaps": "2fa44821 69a68226 b2cef126 7d2e5fb3 62dbdb20 72209675 acef606d 006470ea b21fe529 3ab7999a da964e75 1209cd30 9e6da239 ba028ddc 84454051 a38b0cf9 8cea238e e7ce450d ad612988 504a7c00 caaecf97 9d741f38 89306431"
|
||||
},
|
||||
"diy-040": {
|
||||
"about": "5_diy1_a=acfend 5_diy2_b=acfend 5_diy1_a=acpion 5_diy2_b=acpion 5_diy1_a=acguad 5_diy2_b=acguad 5_diy1_a=ccast 5_diy2_b=ccast 5_diy1_a=cmedic 5_diy2_b=cmedic 5_diy1_a=csuppo 5_diy2_b=csuppo",
|
||||
"fast": false,
|
||||
"kind": "normal",
|
||||
"stageId": "act1autochess_m07",
|
||||
"modeId": "mode_multi_abyss",
|
||||
"round": 12,
|
||||
"seed": 4204057621,
|
||||
"waveId": "act1autochess_h05",
|
||||
"time": 230,
|
||||
"ticks": 6900,
|
||||
"reason": "timeout",
|
||||
"killed": 0,
|
||||
"total": 60,
|
||||
"unspawned": 0,
|
||||
"bossHpLeft": null,
|
||||
"rngDraws": 24,
|
||||
"errors": {"count":0,"kinds":[]},
|
||||
"players": {"p1":{"killed":0,"total":60,"perfect":false,"leaks":60,"leaksUncounted":0,"coins":0,"dmg":228914,"bossDmg":0,"heal":0,"deaths":15,"layerGains":{}}},
|
||||
"units": [
|
||||
["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,82,0,71,7812,0,5,0],
|
||||
["p1",2,"op","chess_char_5_diy2_b",2,"uniequip_002_acfend",675.54,1,84,0,2254,9437,0,52,2],
|
||||
["p1",3,"op","chess_char_5_diy1_a",2,null,0,0,80,0,2618,4587,0,10,1],
|
||||
["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acpion",0,0,78,0,4995,5712,0,17,1],
|
||||
["p1",5,"op","chess_char_5_diy1_a",2,null,2638,1,85,0,1003,5276,0,12,0],
|
||||
["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acguad",3411,1,86,0,29363,6822,0,29,1],
|
||||
["p1",7,"op","chess_char_5_diy1_a",2,null,1133,1,4,0,40162,0,0,86,3],
|
||||
["p1",8,"op","chess_char_5_diy2_b",2,"none",1360,1,7,0,47763,0,0,87,3],
|
||||
["p1",9,"op","chess_char_5_diy1_a",2,null,1218,1,9,0,0,0,0,0,0],
|
||||
["p1",10,"op","chess_char_5_diy2_b",2,"none",1374,1,11,0,0,0,0,0,0],
|
||||
["p1",11,"op","chess_char_5_diy1_a",2,null,932,1,13,0,29230,0,0,74,2],
|
||||
["p1",12,"op","chess_char_5_diy2_b",2,"none",1131,1,5,0,71456,0,0,154,4],
|
||||
["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null],
|
||||
["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null]
|
||||
],
|
||||
"enemies": {"enemy_1045_hammer_2":[12,0,12,11679,29920],"enemy_1061_zomshd":[48,0,47,27967,198994]},
|
||||
"hooks": [1,86,6900,614,614,638,630,18665,15,74,17,15,0,23511,230,32,60,59,1,17,0,0,8],
|
||||
"events": {"atk":614,"deploy":24,"die":15,"dmg":630,"fx":30,"leak":59,"skill":32,"spawn":74,"status":464},
|
||||
"fx": {"aoe":4,"dodge":8,"dp":2,"slash":16},
|
||||
"snaps": "55d29c01 137a0f46 4141bbfd 7089b49a ee191823 68945e1a 43ec812f d17c03a8 01486d26 5b26dde8 ce02b619 845c68e2 379c94bf f6905a41 8bec372a e1f60831 bf9ad198 ed155d25 e54254a4 a2e404f1 e9112874 40dca7a0 65049e51"
|
||||
},
|
||||
"diy-041": {
|
||||
"about": "5_diy1_a=sharp2 5_diy2_b=sharp2 5_diy1_a=acspec 5_diy2_b=acspec 5_diy1_a=acnipe 5_diy2_b=acnipe 5_diy1_a=accast 5_diy2_b=accast 5_diy1_a=acmedc 5_diy2_b=acmedc 5_diy1_a=acsupo 5_diy2_b=acsupo",
|
||||
"fast": false,
|
||||
"kind": "normal",
|
||||
"stageId": "act2autochess_m01",
|
||||
"modeId": "mode_multi_funny",
|
||||
"round": 12,
|
||||
"seed": 2453815680,
|
||||
"waveId": "act1autochess_h05",
|
||||
"time": 186.23,
|
||||
"ticks": 5587,
|
||||
"reason": "cleared",
|
||||
"killed": 117,
|
||||
"total": 117,
|
||||
"unspawned": 0,
|
||||
"bossHpLeft": null,
|
||||
"rngDraws": 201,
|
||||
"errors": {"count":0,"kinds":[]},
|
||||
"players": {"p1":{"killed":117,"total":117,"perfect":true,"leaks":0,"leaksUncounted":0,"coins":0,"dmg":465120,"bossDmg":0,"heal":41772,"deaths":2,"layerGains":{}}},
|
||||
"units": [
|
||||
["p1",1,"op","chess_char_5_diy1_a",0,null,1865,1,6,7,30628,0,0,34,2],
|
||||
["p1",2,"op","chess_char_5_diy2_b",0,"uniequip_002_sharp2",2374,1,9,36,169772,0,0,133,3],
|
||||
["p1",3,"op","chess_char_5_diy1_a",2,null,800.84,1,131,0,0,2661,0,0,0],
|
||||
["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acspec",1448,1,7,0,0,0,0,0,0],
|
||||
["p1",5,"op","chess_char_5_diy1_a",2,null,1272,1,2,2,31621,0,0,77,2],
|
||||
["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acnipe",1587,1,3,2,52971,0,0,79,2],
|
||||
["p1",7,"op","chess_char_5_diy1_a",2,null,1372,1,4,0,0,0,0,0,0],
|
||||
["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_accast",1749,1,11,64,174591,788,0,75,3],
|
||||
["p1",9,"op","chess_char_5_diy1_a",2,null,1224,1,8,0,0,0,21828,57,2],
|
||||
["p1",10,"op","chess_char_5_diy2_b",2,"uniequip_002_acmedc",1414,1,12,0,0,40984,19945,54,3],
|
||||
["p1",11,"op","chess_char_5_diy1_a",2,null,1160,1,1,0,0,0,0,0,0],
|
||||
["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acsupo",1430,1,5,6,5537,0,0,12,1]
|
||||
],
|
||||
"enemies": {"enemy_1005_yokai":[51,51,0,0,39168],"enemy_1005_yokai_2":[54,54,0,7242,80352],"enemy_1005_yokai_3":[12,12,0,37192,345600]},
|
||||
"hooks": [1,131,5587,747,747,826,943,181,119,119,18,17,0,25353,30,0,117,0,1,119,0,0,0],
|
||||
"events": {"atk":791,"deploy":14,"die":119,"dmg":943,"fx":8,"heal":130,"skill":33,"spawn":129,"status":22},
|
||||
"fx": {"aoe":8},
|
||||
"snaps": "c9844d80 ed7a1b55 d98f60d1 b7552333 c9d7859c 85c0287b 82bbddbc a6c50613 056aff9b 924dfb3b aef7f0a5 559859eb 7d1f5e69 12531b10 3e40e3a2 42d4c2ca fbd7bf8e cae939db 97bd2db3"
|
||||
},
|
||||
"diy-042": {
|
||||
"about": "6_diy1_a=acfend 6_diy2_b=acfend 6_diy1_a=acpion 6_diy2_b=acpion 6_diy1_a=acguad 6_diy2_b=acguad 6_diy1_a=acnipe 6_diy2_b=acnipe 6_diy1_a=accast 6_diy2_b=accast 6_diy1_a=acmedc 6_diy2_b=acmedc",
|
||||
"fast": false,
|
||||
"kind": "normal",
|
||||
"stageId": "act2autochess_m02",
|
||||
"modeId": "mode_single_hard",
|
||||
"round": 13,
|
||||
"seed": 813682325,
|
||||
"waveId": "act1autochess_h06",
|
||||
"time": 204.5,
|
||||
"ticks": 6135,
|
||||
"reason": "cleared",
|
||||
"killed": 21,
|
||||
"total": 105,
|
||||
"unspawned": 0,
|
||||
"bossHpLeft": null,
|
||||
"rngDraws": 203,
|
||||
"errors": {"count":0,"kinds":[]},
|
||||
"players": {"p1":{"killed":21,"total":105,"perfect":false,"leaks":84,"leaksUncounted":0,"coins":0,"dmg":387639,"bossDmg":0,"heal":74750,"deaths":14,"layerGains":{}}},
|
||||
"units": [
|
||||
["p1",1,"op","chess_char_6_diy1_a",2,null,0,0,123,0,42,7812,0,3,0],
|
||||
["p1",2,"op","chess_char_6_diy2_b",2,"uniequip_002_acfend",0,0,122,0,129,10293,0,8,0],
|
||||
["p1",3,"op","chess_char_6_diy1_a",2,null,0,0,120,4,12864,5267,0,13,1],
|
||||
["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acpion",0,0,119,6,61348,7713,0,16,3],
|
||||
["p1",5,"op","chess_char_6_diy1_a",2,null,2638,1,110,5,46735,24288,0,63,4],
|
||||
["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acguad",3531,1,116,4,107368,53950,0,65,4],
|
||||
["p1",7,"op","chess_char_6_diy1_a",2,null,1272,1,8,0,1305,0,0,12,1],
|
||||
["p1",8,"op","chess_char_6_diy2_b",2,"uniequip_002_acnipe",1643,1,9,1,22245,0,0,112,2],
|
||||
["p1",9,"op","chess_char_6_diy1_a",2,null,1372,1,13,0,5721,0,0,10,1],
|
||||
["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_accast",1819,1,4,1,129881,0,0,75,2],
|
||||
["p1",11,"op","chess_char_6_diy1_a",2,null,1224,1,6,0,0,0,34513,43,2],
|
||||
["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_002_acmedc",1464,1,10,0,0,0,40237,43,2],
|
||||
["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null],
|
||||
["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null]
|
||||
],
|
||||
"enemies": {"enemy_1165_duhond":[51,14,37,1617,98010],"enemy_1174_duholy_2":[24,0,24,11049,80574],"enemy_1175_dushdo_2":[30,7,23,96657,209055]},
|
||||
"hooks": [1,129,6135,667,667,924,921,170,35,119,22,21,0,26294,0,48,105,84,1,54,0,0,3],
|
||||
"events": {"atk":735,"deploy":22,"die":35,"dmg":921,"fx":63,"heal":165,"leak":84,"skill":43,"spawn":119,"status":213},
|
||||
"fx": {"aoe":6,"dodge":3,"dp":14,"slash":27,"spGain":13},
|
||||
"snaps": "3cd53cb0 c89b2368 40b28879 59bff952 5a64be7e 30701bd3 7477ea7e 2456da9c 8bf2c8d0 952f99f8 203f6c6a 8dec7426 387a1424 cfbf0fa2 0fbe2619 a8d8c27b 465f68b8 38c87469 23c13bb1 0f2fc6c7 dc5e3ec1"
|
||||
},
|
||||
"diy-043": {
|
||||
"about": "6_diy1_a=sharp2 6_diy2_b=sharp2 6_diy1_a=acspec 6_diy2_b=acspec 6_diy1_a=acsupo 6_diy2_b=acsupo",
|
||||
"fast": false,
|
||||
"kind": "normal",
|
||||
"stageId": "act2autochess_m03",
|
||||
"modeId": "mode_multi_normal",
|
||||
"round": 13,
|
||||
"seed": 1440042731,
|
||||
"waveId": "act1autochess_h06",
|
||||
"time": 230,
|
||||
"ticks": 6900,
|
||||
"reason": "timeout",
|
||||
"killed": 5,
|
||||
"total": 117,
|
||||
"unspawned": 0,
|
||||
"bossHpLeft": null,
|
||||
"rngDraws": 269,
|
||||
"errors": {"count":0,"kinds":[]},
|
||||
"players": {"p1":{"killed":5,"total":117,"perfect":false,"leaks":112,"leaksUncounted":0,"coins":0,"dmg":238841,"bossDmg":0,"heal":0,"deaths":20,"layerGains":{}}},
|
||||
"units": [
|
||||
["p1",1,"op","chess_char_6_diy1_a",0,null,0,0,142,2,38305,5595,0,40,1],
|
||||
["p1",2,"op","chess_char_6_diy2_b",0,"uniequip_002_sharp2",160.54,1,144,3,80636,7321,0,49,1],
|
||||
["p1",3,"op","chess_char_6_diy1_a",2,null,0,0,141,0,16517,9232,0,98,0],
|
||||
["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acspec",1484,1,143,0,42548,10388,0,80,0],
|
||||
["p1",5,"op","chess_char_6_diy1_a",2,null,1160,1,6,0,23478,0,0,157,3],
|
||||
["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acsupo",1450,1,7,0,37358,0,0,171,3],
|
||||
["-","~1","device","trap_1105_accrate",null,null,100,1,1,0,0,0,0,0,null],
|
||||
["-","~2","device","trap_1105_accrate",null,null,100,1,2,0,0,0,0,0,null],
|
||||
["-","~3","device","trap_1105_accrate",null,null,100,1,3,0,0,0,0,0,null]
|
||||
],
|
||||
"enemies": {"enemy_1166_dusbr_2":[39,3,36,7541,82135],"enemy_1169_duphlx_2":[57,2,54,10159,100700],"enemy_1172_dugago":[21,0,20,14836,56006]},
|
||||
"hooks": [1,144,6900,714,714,887,957,0,25,135,8,21,0,11777,11673,31,117,110,1,25,0,0,0],
|
||||
"events": {"atk":755,"deploy":24,"die":25,"dmg":899,"fx":33,"leak":110,"skill":14,"spawn":126,"status":1124},
|
||||
"fx": {"displace":24,"dodge":9},
|
||||
"snaps": "9bbd23cd 2d4db0d2 0b708c5d e12c3e68 e2172814 260b1a9b 80c15326 e5bfb4ae ebfb431f aa6ad13b 090dd69e 08cd9a4a 90873d2d 538a19f4 91a7f5a8 94fe8900 215e97c9 c6bde6b7 d23df7d4 babbeb8e 2e8c6850 80a40788 51003e6c"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
// test/sim/feedback5-hpdamage-hook.test.js — the `hpDamage` hook of damage.js dealDamage (0.2.0, the 自选 operator kits):
|
||||
// what passed the shields of a damage instance, before the HP loss; a handler may only lower it — the 伤判效果 that act
|
||||
// after a barrier (煌's 紧急除颤 HP floor, 左乐's 庇护 re-applied behind his 行险 barrier). A 流失 (Battle.loseHp) never
|
||||
// reaches it, a hit the shields absorb whole neither. docs/SIM.md §4 / §5.
|
||||
// Run: node --test test/sim/feedback5-hpdamage-hook.test.js
|
||||
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { makeBattle, enemyRec, checkInvariants } from '../helpers/battleHarness.js';
|
||||
|
||||
function arena() {
|
||||
const h = makeBattle({
|
||||
defs: { enemies: { enemy_dummy: enemyRec({ key: 'enemy_dummy', hp: 1e6, speed: 0, mass: 0 }) } },
|
||||
units: [{ uid: 1, chessId: 'chess_char_1_02_a', row: 10, col: 5 }], timeLimit: 60, autoFinish: false,
|
||||
});
|
||||
h.step();
|
||||
const u = h.unit(1), e = h.spawn('enemy_dummy', { pos: [10, 8] });
|
||||
return { h, u, e };
|
||||
}
|
||||
|
||||
test('hpDamage: after the shields, before the HP loss — a handler lowers what reaches the HP; a raise is ignored', () => {
|
||||
const { h, u, e } = arena();
|
||||
const seen = [];
|
||||
const off = h.b.on('hpDamage', (c) => { if (c.target === u) { seen.push([c.amount, c.source, c.dmg.type]); c.amount = Math.min(c.amount, 100); } });
|
||||
h.b.addBuff(u, { key: 'test:shield', shield: 300 });
|
||||
const hp = u.hp;
|
||||
const dealt = h.b.dealDamage(e, u, { amount: 1000, type: 'true' });
|
||||
assert.deepEqual(seen, [[700, e, 'true']], 'the 300 shield first, then the hook sees the 700 that passed');
|
||||
assert.equal(u.findBuff('test:shield'), null, 'the shield was spent');
|
||||
assert.deepEqual([hp - u.hp, dealt], [100, 100], 'HP loss and the returned amount follow the lowered value');
|
||||
h.b.off(off);
|
||||
h.b.on('hpDamage', (c) => { if (c.target === u) c.amount = 1e9; });
|
||||
const hp2 = u.hp;
|
||||
h.b.dealDamage(e, u, { amount: 50, type: 'true' });
|
||||
assert.equal(hp2 - u.hp, 50, 'a raise is ignored');
|
||||
checkInvariants(h.b);
|
||||
});
|
||||
|
||||
test('hpDamage: no call for a 流失 nor for a hit the shields take whole; without a handler nothing changes', () => {
|
||||
const { h, u, e } = arena();
|
||||
let n = 0;
|
||||
h.b.on('hpDamage', (c) => { if (c.target === u) n++; });
|
||||
h.b.loseHp(u, 100, { source: e });
|
||||
assert.equal(n, 0, 'a 流失 skips it (no 伤判效果)');
|
||||
h.b.addBuff(u, { key: 'test:shield', shield: 500 });
|
||||
h.b.dealDamage(e, u, { amount: 200, type: 'true' });
|
||||
assert.equal(n, 0, 'absorbed whole: nothing reaches the HP');
|
||||
h.b.dealDamage(e, u, { amount: 400, type: 'true' });
|
||||
assert.equal(n, 1, 'the 100 that passed');
|
||||
const r = arena();
|
||||
const hp = r.u.hp;
|
||||
r.h.b.dealDamage(r.e, r.u, { amount: 250, type: 'true' });
|
||||
assert.equal(hp - r.u.hp, 250, 'no handler: the plain pipeline');
|
||||
checkInvariants(h.b);
|
||||
});
|
||||
Reference in new issue
Block a user