From f44e524afd2d7430239cce7a88c7e19c0dea9b0a Mon Sep 17 00:00:00 2001 From: sganggs Date: Tue, 6 Oct 2026 01:25:29 +0800 Subject: [PATCH] =?UTF-8?q?feedback5=20O13:=20=E8=87=AA=E9=80=89=20operato?= =?UTF-8?q?r=20kits=20=E5=81=87=E6=97=A5=E5=A8=81=E9=BE=99=E9=99=88,=20?= =?UTF-8?q?=E8=8E=B1=E4=BC=8A=20(with=20her=20=E6=B2=99=E5=9C=B0=E5=85=BD)?= =?UTF-8?q?=20and=20=E9=98=BF=E6=96=AF=E5=8D=A1=E7=BA=B6=20=E2=80=94=20eve?= =?UTF-8?q?ry=20skill,=20talent,=20trait=20and=20module=20(stage=201=20/?= =?UTF-8?q?=203)=20at=20every=20form?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - op-chen2.js: 散射手 trait (RPR-X 160 %, RPR-Y cost −8); 节约风气 (20 % own / 20 % other snipers per PRTS 修正, RPR-X stage 3 25 / 20 / 12 %; one roll per attack, the ammoUsed events still fire); 假日余韵 (+8 ASPD; RPR-Y stage 3 +15 % / +12 and the skill-time water TAG: +28 % / +20); S1 ammo 4; S2 ammo 8, 蓄力 20, slime; S3 2-6, 2 hits, 32 bullets 2 per attack, slime. - op-ray.js: 猎手 reload of her base attack time (PRTS 分支特性信息; HUN-X +1 on an empty magazine, HUN-Y ×1.33); 巡哨伙伴 and the 沙地兽's kit (25 s scouting: extra range and trigger range, area targets first, ×1.15 / 1.2; leaves, comes back after its redeploy time paying 3 DP, withdrawn with her); 入神 layers; S1 special bullet + push + kill bonus; S2 toggle at full SP (4-10, bullet recovery, redeploy −20 / 30 %); S3 fill at 0.4 s, 3-8, bind, +10 SP on a kill. - op-ascln.js: 伏击客 dodge without a second taunt −1; 死亡拘审 layers (move ×(1 − 0.18 n), n × 10 % ATK arts / s; AMB-X stage 3 11 % / 30 s; AMB-Y stage 3 heal on a marked knock-out); 噬光残影 high-ground ASPD; S1 two strikes; S2 slow on every enemy (PRTS 修正) and the 1.3 spread; S3 y-10, taunt +2, 命中率 cut with heals on misses / dodges; AMB-X stacking slow. - Tests: test/content/op_chen2.test.js, op_ray.test.js, op_ascln.test.js (9 each). - Golden: only diy moved — diy-049 … 054 now field the three new kits, the prototypes moved to diy-055 … 058 (new ids, same packing); diy-001 … 048 and the roster / bonds / fields / matches / standins families unchanged. --- server/sim/content/kits/index.js | 3 + server/sim/content/kits/ops/op-ascln.js | 256 ++++++++++++++ server/sim/content/kits/ops/op-chen2.js | 266 ++++++++++++++ server/sim/content/kits/ops/op-ray.js | 311 ++++++++++++++++ test/content/op_ascln.test.js | 311 ++++++++++++++++ test/content/op_chen2.test.js | 360 +++++++++++++++++++ test/content/op_ray.test.js | 371 ++++++++++++++++++++ test/golden/diy.json | 448 ++++++++++++++++++------ 8 files changed, 2222 insertions(+), 104 deletions(-) create mode 100644 server/sim/content/kits/ops/op-ascln.js create mode 100644 server/sim/content/kits/ops/op-chen2.js create mode 100644 server/sim/content/kits/ops/op-ray.js create mode 100644 test/content/op_ascln.test.js create mode 100644 test/content/op_chen2.test.js create mode 100644 test/content/op_ray.test.js diff --git a/server/sim/content/kits/index.js b/server/sim/content/kits/index.js index 99f513f5..074b70ea 100644 --- a/server/sim/content/kits/index.js +++ b/server/sim/content/kits/index.js @@ -103,6 +103,9 @@ export const OPERATOR_KIT_FILES = Object.freeze([ 'op-ifrit.js', 'op-aphris.js', 'op-lin.js', + 'op-chen2.js', + 'op-ray.js', + 'op-ascln.js', ]); /** diff --git a/server/sim/content/kits/ops/op-ascln.js b/server/sim/content/kits/ops/op-ascln.js new file mode 100644 index 00000000..9ff09d19 --- /dev/null +++ b/server/sim/content/kits/ops/op-ascln.js @@ -0,0 +1,256 @@ +// server/sim/content/kits/ops/op-ascln.js — 阿斯卡纶 (char_4132_ascln) 自选 operator kit: 6★ 伏击客 (特种), an owned-6★ pick +// of the tier-5 and tier-6 自选 slots; every skill, both talents, the trait and both modules (AMB-X “无形,无情”, AMB-Y +// “阿斯卡纶的眼睛”) at every form. Kit contract and the 自选 rules: ../README.md ("How to add an operator (自选)"). +// +// Forms (data/backups.json units.char_4132_ascln): 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) — the owner's decision of 2026-10-05. Potential 0 [ASSUMED: no +// account]. Sources: character_table / skill_table / battle_equip_table (zh_CN, as built into backups.json) and PRTS +// 阿斯卡纶 (死亡拘审 备注 and its {{**}} 最终乘算 (100−18×层数)%, S2 修正 / 备注, S3 备注, the AMB-X note), PRTS 分支特性信息 +// 伏击客 ("嘲讽等级为-1"), PRTS 命中率, Arknights Terra Wiki "Ascalon" (死亡拘审: "The MSPD reduction and Arts damage stack +// additively"). +// - Trait (伏击客) "对攻击范围内所有敌人造成伤害;拥有50%的物理和法术闪避且不容易成为敌人的攻击目标": the stalker profile — every +// enemy of her range at once, melee, ground only (no "可对空"), physical — and 50 % physical / arts dodge (trait bb prob; +// AMB-Y: 65 %). "不容易成为敌人的攻击目标" is her taunt level −1, which her data stats already carry (PRTS 伏击客 "嘲讽等级为 +// -1"): the kit trait installs the dodge without the profile's own extra −1 (professions.js installStalker adds one on +// top of the data's — a double count reported for 水月, whose kit keeps the profile; not changed here). +// AMB-X adds "攻击范围内所有敌人移动速度-20%" (hidden talent move_speed): every enemy of her current range, air units too, +// moves ×(1 + move_speed); PRTS "多个伏击客X模组之间的减速效果可叠加" — one slow per 阿斯卡纶 (her own key). +// - T1 死亡拘审 "攻击对敌人施加效果:移动速度降低18%,每秒受到10%阿斯卡纶当前攻击力的法术伤害,持续25秒,效果最多叠加三层" +// (bb move_speed / atk_ratio / max_stack_cnt / debuff_duration / interval): every damage instance of her attacks (S1's two +// strikes are two attacks) adds a layer (≤ max_stack_cnt) and resets the duration (PRTS 备注); the target moves +// ×(1 − 0.18 × layers) (PRTS 最终乘算 (100−18×层数)%) and takes layers × atk_ratio × her CURRENT ATK as arts damage every +// `interval` s (Terra Wiki: both parts stack additively; PRTS 伤害分类 法术持续伤害 — not dodgeable, tag 'dot'); "自身退场后, +// 所有已施加的本天赋效果将立刻结束". One effect per 阿斯卡纶 [ASSUMED]. AMB-X stage 3: 11 %, 30 s (the talent change). +// AMB-Y stage 3 adds "拥有该效果的敌人被击倒时阿斯卡纶回复10%生命" (hp_ratio): a heal of hp_ratio × her max HP whoever knocks +// such an enemy out, while she is on the field. +// - T2 噬光残影 "攻击速度+8,自身周围四格有高台时,攻击速度额外+6" (bb attack_speed / attack_speed_add / cnt): ASPD +8, +6 more +// while at least `cnt` of the four tiles next to her are 高台 (heightType HIGHLAND in the level files — the 高台 deploy +// tiles and the HIGHLAND forbidden tiles), judged at each deployment. +// - S1 追袭 (AUTO, 2 / 3 charges, data DEFAULT — a "next attack" skill): the next attack at atk_scale × ATK and "连续攻击两 +// 次": every enemy of her range struck twice (bb cnt is the charge count, not the strikes). +// - S2 恩赐 (MANUAL, 35 s, data DEFAULT): ATK +atk; PRTS 修正 (原因 "描述与游戏实际表现不符合"): "使攻击范围内所有敌人移动速度 +// -N%" — every enemy of her range, air units too, moves ×(1 − |move_speed|) (refreshed every AURA_IV s, 同名 keeps the +// strongest — two 阿斯卡纶 do not stack [ASSUMED]) — and "在地面敌人被击倒时对周围地面敌人施加一层第一天赋效果": a ground +// enemy of her range knocked out (by anyone [ASSUMED]) gives one 死亡拘审 layer to every selectable ground enemy within +// range_radius (PRTS 备注 "尸爆半径1.3", a 中点判定 around it). +// - S3 降临 (MANUAL, 45 s, data ACTIVE_RANGE on its y-10): range y-10, ATK +atk, base attack time + base_attack_time s +// (−1.2 / −1.5 on 3.5 s), taunt level +taunt_level (PRTS 备注 "从-1提升至1"); ground enemies of her range have their +// 物理 / 法术命中率 −N % (PRTS 命中率: an attack of that damage type rolls once when it starts and misses as a whole — +// every target and hit of it; here one roll per enemy attack at its first damage instance, a battle-wide `hit` handler +// as 娜仁图亚's / Raidian's, the strongest of the 阿斯卡纶 whose range holds the attacker; several kinds of 命中率 cuts roll +// apart [ASSUMED]); "敌人未命中自身或自身闪避时回复5%最大生命值": attack@hp_ratio × her max HP for each enemy attack her cut +// makes miss her and each dodge of hers, while it runs (a heal: no 生命回复速度 note). + +import { num, talentBb, moduleBb, traitBb, skillRec, up, batMod } from '../shared/tier1.js'; +import { canTargetEnemy } from '../../../targeting.js'; +import { bodyInKeys } from '../../../body.js'; +import { hasHp } from '../../../damage.js'; + +const S1 = 'skchr_ascln_1'; +const S2 = 'skchr_ascln_2'; +const S3 = 'skchr_ascln_3'; +/** Refresh period / length of the range auras (S2's slow, AMB-X's slow): the kits' non-stacking aura convention. */ +const AURA_IV = 0.25; +const AURA_DUR = 0.4; +/** S3's 命中率 handler runs before the enemy content's own hit riders (priority 200), after Raidian's / 娜仁图亚's (300). */ +const MISS_PRIORITY = 290; +/** Tag of the 死亡拘审 ticks (法术持续伤害). */ +export const DREAD_TAG = 'ascln:dread'; +const ANY = Object.freeze({ canHitFly: true }); +/** The four tiles next to her (offsets: direction does not matter). */ +const ADJ4 = Object.freeze([[1, 0], [-1, 0], [0, 1], [0, -1]]); + +const bbOf = (chess, id) => skillRec(chess, id)?.bb ?? {}; +/** Buff key of her 死亡拘审 on an enemy (one per 阿斯卡纶). */ +export const dreadKey = (src) => `ascln:dread#${src.id}`; + +/** + * One layer of 死亡拘审 from `src` on enemy `e` (talent blackboard `tb`): ≤ max_stack_cnt layers, the duration reset, + * move ×(1 − ms × layers), layers × atk_ratio × src's current ATK arts every interval s while src is on the field. + */ +export function addDread(battle, src, e, tb) { + if (!e || !e.alive || e.side !== 'enemy' || !hasHp(e)) return null; + const key = dreadKey(src); + const max = Math.max(1, Math.floor(num(tb.max_stack_cnt, 3))); + const ms = Math.abs(num(tb.move_speed)), dur = num(tb.debuff_duration, 25), iv = num(tb.interval, 1), ratio = num(tb.atk_ratio); + if (!(dur > 0)) return null; + const old = e.findBuff(key); + const n = Math.min(max, (old?.data?.n ?? 0) + 1); + const mods = { moveMul: Math.max(0, 1 - ms * n) }; + if (old) { + old.data.n = n; + old.mods = mods; + old.timeLeft = dur; + old.duration = dur; + e.markDirty(); + return old; + } + return battle.addBuff(e, { + key, duration: dur, mods, source: src, interval: iv > 0 ? iv : 1, data: { n }, tags: ['talent', 'dot'], + onTick: ({ battle: b, unit: t, buff }) => { + if (!up(src)) { b.removeBuff(t, buff); return; } + if (ratio > 0) b.dealDamage(src, t, { amount: src.s.atk * ratio * buff.data.n, type: 'arts', canDodge: false, tags: ['talent', 'dot', DREAD_TAG] }); + }, + }); +} + +// ---- S3 命中率: one battle-wide handler over every 阿斯卡纶 of the battle --------------------------------------------------- +/** battle → { srcs: [{ unit, phys, arts, heal }], last: WeakMap(enemy → { id, miss }) }. */ +const MISS = new WeakMap(); +const s3On = (u) => !!(u.skill && u.skill.active && u.skill.id === S3); + +function missCut(st, e, type) { + let cut = 0; + for (const s of st.srcs) { + const v = type === 'arts' ? s.arts : s.phys; + if (v > cut && up(s.unit) && s3On(s.unit) && s.unit.rangeKeySet && bodyInKeys(e, s.unit.rangeKeySet)) cut = v; + } + return Math.min(1, cut); +} + +function missHit(battle, st, ctx) { + const e = ctx.source, d = ctx.dmg; + if (!e || e.side !== 'enemy' || e.isFlying || !d || !d.isAttack || d.cancel || (d.type !== 'phys' && d.type !== 'arts')) return; + // one roll per attack: every damage instance of it shares the first instance's result + const prev = d.attackId ? st.last.get(e) : null; + let miss, first = false; + if (prev && prev.id === d.attackId) miss = prev.miss; + else { + first = true; + const cut = missCut(st, e, d.type); + miss = cut > 0 && battle.rng() < cut; + if (d.attackId) st.last.set(e, { id: d.attackId, miss }); + } + if (!miss) return; + d.cancel = true; + ctx.stopPropagation = true; + const t = ctx.target; + if (t) battle.fx('dodge', { x: t.x, y: t.y, id: t.id }); + // 敌人未命中自身: the 阿斯卡纶 it aimed at heals (once per missed attack) + if (first && t) for (const s of st.srcs) if (s.unit === t && up(t) && s3On(t) && s.heal > 0) battle.heal(t, t, t.s.maxHp * s.heal, { self: true }); +} + +function installMiss(battle, unit, phys, arts, heal) { + if (!(phys > 0) && !(arts > 0)) return; + let st = MISS.get(battle); + if (!st) { + st = { srcs: [], last: new WeakMap() }; + MISS.set(battle, st); + // no owner: it serves every 阿斯卡纶 of the battle, whichever is on the field + battle.on('hit', (ctx) => missHit(battle, st, ctx), { priority: MISS_PRIORITY }); + } + st.srcs.push({ unit, phys, arts, heal }); +} + +export default { + char_4132_ascln: (bb, chess) => { + const b1 = bbOf(chess, S1), b2 = bbOf(chess, S2), b3 = bbOf(chess, S3); + const s3 = skillRec(chess, S3); + const t0 = talentBb(chess, 0), t1 = talentBb(chess, 1); + const hidden = moduleBb(chess); + const dodge = num(traitBb(chess).prob, 0.5); + const picked = chess?.skill?.skillId ?? null; + return { + trait: { + // 伏击客: the dodge; the taunt level −1 is in her stats (no second −1) + install(battle, unit) { + const p = num(unit.profile?.dodge, dodge); + if (p > 0) battle.addBuff(unit, { key: 'trait:stalker', mods: { dodgePhys: p, dodgeArts: p }, persist: true, allowDead: true }); + }, + }, + skills: { + [S1]: { + kind: num(skillRec(chess, S1)?.maxChargeTime, 1) > 1 ? 'charges' : 'instant', + attack: { atkScale: num(b1.atk_scale, 1), hits: 2 }, + }, + [S2]: { + kind: 'duration', + mods: { atkPct: num(b2.atk) }, + }, + [S3]: { + kind: 'duration', + mods: { atkPct: num(b3.atk), batPct: batMod(b3.base_attack_time, chess), taunt: num(b3.taunt_level) }, + targeting: s3?.rangeGrid ? { rangeGrid: s3.rangeGrid.map((p) => [p[0], p[1]]) } : undefined, + }, + }, + talents: [ + { install(battle, unit) { // 死亡拘审 (+ AMB-Y stage 3: a heal when an enemy carrying it is knocked out) + battle.on('damaged', (ctx) => { + const d = ctx.dmg, e = ctx.target; + if (ctx.source !== unit || !up(unit) || !d || !d.isAttack || !e || e.side !== 'enemy' || d.type === 'element') return; + addDread(battle, unit, e, t0); + }, { owner: unit }); + const key = dreadKey(unit); + battle.on('death', (ctx) => { + const u = ctx.unit; + if (u === unit) { // 自身退场后,所有已施加的本天赋效果将立刻结束 + for (const e of battle.enemies) if (e.findBuff(key)) battle.removeBuff(e, key); + return; + } + const hr = num(t0.hp_ratio); + if (hr > 0 && u.side === 'enemy' && ctx.reason === 'killed' && up(unit) && u.findBuff(key)) battle.heal(unit, unit, unit.s.maxHp * hr, { self: true }); + }, { owner: unit }); + } }, + { install(battle, unit) { // 噬光残影: ASPD +8, +6 with 高台 among the four tiles next to her + const base = num(t1.attack_speed), add = num(t1.attack_speed_add), cnt = Math.max(1, Math.floor(num(t1.cnt, 1))); + const KEY = 'talent:ascln:shadow'; + const apply = (r, c) => { + let n = 0; + for (const [dr, dc] of ADJ4) { + const rr = r + dr, cc = c + dc; + if (battle.grid.inBounds(rr, cc) && battle.grid.tile(rr, cc).height === 'HIGH') n++; + } + const v = base + (n >= cnt ? add : 0); + if (v) battle.addBuff(unit, { key: KEY, mods: { aspd: v }, persist: true, allowDead: true, tags: ['talent'], data: { high: n } }); + }; + apply(unit.homeR ?? unit.tileR, unit.homeC ?? unit.tileC); + battle.on('deploy', (ctx) => { if (ctx.unit === unit) apply(unit.tileR, unit.tileC); }, { owner: unit }); + } }, + ], + install(battle, unit) { + // AMB-X: every enemy of her range moves ×(1 + move_speed) (one slow per 阿斯卡纶: they stack — PRTS) + const mx = num(hidden.move_speed); + if (mx < 0) { + const key = `ascln:ambx#${unit.id}`; + battle.every(AURA_IV, () => { + if (!up(unit)) return; + for (const e of battle.enemiesInKeys(unit.rangeKeys, unit, ANY)) battle.addBuff(e, { key, duration: AURA_DUR, mods: { moveMul: Math.max(0, 1 + mx) }, source: unit, tags: ['module'] }); + }, { owner: unit, immediate: true }); + } + if (picked === S2) { + const ms = Math.abs(num(b2.move_speed)), radius = num(b2.range_radius, 1.3); + const slow = () => { + if (!up(unit) || !unit.skill?.active) return; + for (const e of battle.enemiesInKeys(unit.rangeKeys, unit, ANY)) { + battle.applyStrongest(e, 'ascln:s2slow', { duration: AURA_DUR, value: ms, mods: (v) => ({ moveMul: Math.max(0, 1 - v) }), source: unit }); + } + }; + if (ms > 0) { + battle.on('skillStart', (ctx) => { if (ctx.unit === unit) slow(); }, { owner: unit }); + battle.every(AURA_IV, slow, { owner: unit }); + } + // a ground enemy of her range knocked out ⇒ one 死亡拘审 layer on the selectable ground enemies within the radius + battle.on('death', (ctx) => { + const v = ctx.unit; + if (ctx.reason !== 'killed' || !v || v.side !== 'enemy' || v.isFlying || !up(unit) || !unit.skill?.active || !unit.rangeKeySet || !bodyInKeys(v, unit.rangeKeySet)) return; + battle.fx('aoe', { x: v.x, y: v.y, radius, id: unit.id, skill: 'ascln:endowment' }); + for (const e of battle.foesInRadius(v.x, v.y, radius, true)) { + if (e !== v && !e.isFlying && canTargetEnemy(unit, e, ANY)) addDread(battle, unit, e, t0); + } + }, { owner: unit }); + } + if (picked === S3) { + const heal = num(b3['attack@hp_ratio']); + installMiss(battle, unit, Math.abs(num(b3['attack@damage_hitrate_physical'])), Math.abs(num(b3['attack@damage_hitrate_magical'])), heal); + // 自身闪避时回复…最大生命值 + if (heal > 0) { + battle.on('dodge', (ctx) => { + if (ctx.target !== unit || !up(unit) || !s3On(unit) || !ctx.source || ctx.source.side !== 'enemy') return; + battle.heal(unit, unit, unit.s.maxHp * heal, { self: true }); + }, { owner: unit }); + } + } + }, + }; + }, +}; diff --git a/server/sim/content/kits/ops/op-chen2.js b/server/sim/content/kits/ops/op-chen2.js new file mode 100644 index 00000000..b8bc05c1 --- /dev/null +++ b/server/sim/content/kits/ops/op-chen2.js @@ -0,0 +1,266 @@ +// server/sim/content/kits/ops/op-chen2.js — 假日威龙陈 (char_1013_chen2) 自选 operator kit: 6★ 散射手 (狙击), an owned-6★ pick +// of the tier-5 and tier-6 自选 slots; every skill, both talents, the trait and both modules (RPR-X 沙滩战斗套装, RPR-Y 假期的 +// 最后一天) at every form. Kit contract and the 自选 rules: ../README.md ("How to add an operator (自选)"). +// +// Forms (data/backups.json units.char_1013_chen2): 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) — the owner's decision of 2026-10-05. Potential 0 [ASSUMED: no +// account]. Sources: character_table / skill_table / battle_equip_table (zh_CN, as built into backups.json) and PRTS +// 假日威龙陈 (节约风气 修正 and 备注, 假日余韵 备注, S2 / S3 备注, the RPR-X stage-1 note); PRTS 作战机制 §地形TAG; PRTS 分支特性 +// 信息 散射手 ("可对空", the trait's 1-3 front grid); gamedata_const ba.charged (蓄力). +// - Trait (散射手) "攻击范围内的所有敌人,对自己前方一横排的敌人攻击力提升至150%": the reaperrange profile — every enemy of +// her range, air units too, ×atk_scale (trait bb) on the trait's front grid (her tile and the three ahead). RPR-X +// overrides it with atk_scale 1.6 (the same trait, 160 %); RPR-Y adds "部署费用减少" (cost −8, in the stats: her +// redeploy after a knock-out costs 8 DP less). Ranged physical arrows; blocks 1; ground enemies target her (no flag). +// - T1 节约风气 "在场时自身弹药类技能攻击时20%概率不消耗对应弹药,其他【狙击】干员的弹药类技能改为10%概率不消耗(同类效果取最 +// 高)": while she is on the field, an attack made by a running 弹药类技能 (PRTS 备注: a skill whose text says "攻击装有X发 +// 弹药 / 子弹" — never the 猎手 bullets) spends no ammo with that chance: hers spareshot_chen.prob, another 【狙击】 +// operator's 20 % — PRTS 修正 (原因 "描述与游戏实际表现不符合", and the RPR-X stage-1 note "实际应为…其他【狙击】干员…20%"): +// the game gives the other snipers what she has, spareshot_chen.prob, not the text's / `prob`'s 10 % [the mechanism is +// ASSUMED; the 20 % is PRTS's]. RPR-X stage 3 (talent change): herself e_spareshot_chen.prob 25 %, other 【狙击】 +// operators …[sniper].prob 20 %, other 远程 (RANGED) operators …[other].prob 12 %. 同类效果取最高: the highest chance of +// every 假日威龙陈 on the field. One roll per attack ("一次性消耗多发弹药时仅进行一次判定"); a spared attack spends nothing +// of what it would ("强制改为实耗0发"), and every `ammoUsed` of it still fires ("不影响以'消耗弹药'为效果触发条件的侦测": +// the bullet is put back in that event, before the skill checks for its last bullet) — 拉特兰 / garrison counters see it. +// - T2 假日余韵 "攻击速度+8,当场地中存在水地形时改为攻击速度+12" ([common].attack_speed 8, [map].attack_speed +4). 水地形 is +// a map TAG (PRTS 作战机制 §地形TAG): no level of this mode carries one (the act1 / act2 autochess level files' mapData.tags +// are null), so +8. RPR-Y stage 3 "攻击力+15%,攻击速度+12,当场地中存在水地形时改为攻击力+28%,攻击速度+20,技能开启时,场地 +// 视为水地形": +15 % / +12, and while her skill runs the field holds the water TAG (PRTS 备注 "在技能期间为当前关卡临时添加 +// '水地形TAG';干员撤退时或技能结束时清除") — +28 % / +20 for her and for every 假日威龙陈 of that field. The module row's +// [map] keys are the text's totals (20 / 0.28), the base row's [map] 4 the step over [common] 8 (8 + 4 = 12): read so. +// - S1 高压冲击 (AUTO, attack SP, data DEFAULT — an attack skill): ATK +atk, 4 bullets (attack@trigger_time), every enemy of +// her range takes the trait's front-row multiplier ("对攻击范围内的所有敌人应用特性加成", as 送葬人 S1). +// - S2 “堇青之夜” (MANUAL, data DEFAULT): ATK +atk, 8 bullets (attack@trigger_time); 蓄力 (maxChargeTime 2; ba.charged "技力达 +// 到上限可继续回复,回复至上限2倍时进入蓄力状态,此时开启技能会触发额外效果(任何时候开启均消耗全部技力)"): cast with both +// charges stored ⇒ attack@another_trigger_time (20) bullets; every cast empties the SP. Every attack leaves slime (below). +// - S3 “假日风暴” (MANUAL, data ACTIVE_RANGE on its 2-6): range 2-6 while it runs, ATK +atk, every attack strikes twice and +// takes the trait multiplier on every enemy, leaves slime; 32 bullets, 2 per attack — PRTS 备注 "即使剩余弹药数小于2发仍 +// 可'消耗2发弹药'进行攻击;技能仅在弹药数归零后自动结束" (one `ammoUsed` per bullet). +// - Slime (S2 / S3 "每次攻击在范围内生成持续5秒的粘液,地面敌人经过时移动速度-N%、防御力-M(不叠加)"): each struck enemy's tile +// holds slime for attack@projectile_life_time s [ASSUMED: one tile under each enemy an attack strikes — the data calls it +// a projectile with a life time]; a ground enemy standing on slime moves ×(1 + attack@move_speed) and has DEF +// attack@def (flat), refreshed every SLIME_IV s so it lapses just after it leaves [ASSUMED]; 不叠加 — one effect, the +// strongest slime under it; PRTS 备注 "粘液的效果无视无法选择类效果(如隐匿与无敌)": stealthed / invulnerable enemies too. +// The slime outlives her [ASSUMED]. Air units never (地面敌人). + +import { num, talentBb, skillRec, up } from '../shared/tier1.js'; +import { bodyKeys } from '../../../body.js'; +import { COLS } from '../../../constants.js'; + +const S1 = 'skchr_chen2_1'; +const S2 = 'skchr_chen2_2'; +const S3 = 'skchr_chen2_3'; +/** PRTS 节约风气 备注: a 弹药类技能 is one whose text says "攻击装有X发弹药" or "攻击装有X发子弹". */ +const AMMO_SKILL = /攻击装有\d+发(?:弹药|子弹)/; +/** Slime refresh period and the length of one refresh (the effect lapses SLIME_DUR s after the enemy leaves it). */ +const SLIME_IV = 0.1; +const SLIME_DUR = 0.15; +/** Buff key of the slime effect on an enemy (one for every 假日威龙陈: 不叠加). */ +export const SLIME_KEY = 'chen2:slime'; + +const bbOf = (chess, id) => skillRec(chess, id)?.bb ?? {}; +const count = (v, d) => Math.max(1, Math.floor(num(v, d))); + +// ---- T1 节约风气: one battle-wide pair of handlers over every 假日威龙陈 of the battle ------------------------------------ +/** battle → { srcs: Map(unit → { self, sniper, other }) }. */ +const SPARE = new WeakMap(); + +/** The spare chance of `u`'s ammo-skill attack: the highest of the 假日威龙陈 on the field (同类效果取最高). */ +export function spareChance(battle, u) { + const st = SPARE.get(battle); + if (!st || !u) return 0; + const op = u.kind === 'op'; + let p = 0; + for (const [s, v] of st.srcs) { + if (!up(s)) continue; + const q = u === s ? v.self : op && u.def?.profession === 'SNIPER' ? v.sniper : op && u.def?.position === 'RANGED' ? v.other : 0; + if (q > p) p = q; + } + return Math.min(1, p); +} + +function installSpare(battle, unit, probs) { + let st = SPARE.get(battle); + if (!st) { + st = { srcs: new Map() }; + SPARE.set(battle, st); + // the roll: when an attack is made by a running 弹药类技能, before its bullets are spent (skills.js onAttackPerformed + // runs after the `attack` hook); one roll per attack (no draw when nobody's chance applies) + battle.on('attack', (ctx) => { + const u = ctx.attacker, sk = u?.skill; + if (!u || u.side !== 'ally' || !sk || !sk.active || sk.kind !== 'ammo' || !AMMO_SKILL.test(String(sk.def?.description ?? ''))) return; + const p = spareChance(battle, u); + u.mem.chen2Spare = { t: battle.time, n: u.stats.attacks, proc: p > 0 && battle.rng.chance(p) }; + if (u.mem.chen2Spare.proc) battle.fx('reload', { x: u.x, y: u.y, id: u.id }); + }, { priority: -50 }); + // the spared attack's every bullet goes back in its own ammoUsed event (the event itself still fires) + battle.on('ammoUsed', (ctx) => { + const u = ctx.unit, m = u?.mem?.chen2Spare, sk = ctx.skill; + if (!m || !m.proc || m.t !== battle.time || m.n !== u.stats.attacks || !sk || !sk.active || sk.kind !== 'ammo') return; + sk.ammoLeft += 1; + }, { priority: 100 }); + } + st.srcs.set(unit, probs); +} + +// ---- 水地形 TAG (RPR-Y stage 3): the units holding it on a battle ------------------------------------------------------- +/** battle → Set(units whose running skill makes the field count as water). */ +const WATER = new WeakMap(); +/** Whether the field of `battle` counts as water terrain now (no level of the mode has the TAG of its own). */ +export const waterOn = (battle) => (WATER.get(battle)?.size ?? 0) > 0; +function setWater(battle, unit, on) { + let s = WATER.get(battle); + if (!s) WATER.set(battle, (s = new Set())); + if (on) s.add(unit); else s.delete(unit); +} + +/** + * 假日余韵's two lines: { common: { atkPct, aspd }, water: { atkPct, aspd } }. The base row's [map] value is the step over + * [common] (8 + 4 = the text's 12); a module row's [map] values are the text's totals (RPR-Y: 改为 +28 % / +20). + */ +export function holidayLines(t) { + const bb = t?.bb ?? {}; + const ca = num(bb['chen2_t_2[common].atk']), cs = num(bb['chen2_t_2[common].attack_speed']); + const ma = num(bb['chen2_t_2[map].atk']), ms = num(bb['chen2_t_2[map].attack_speed']); + const total = !!t?.fromModule; + return { common: { atkPct: ca, aspd: cs }, water: total ? { atkPct: ma || ca, aspd: ms || cs } : { atkPct: ca + ma, aspd: cs + ms } }; +} + +// ---- slime (S2 / S3): one battle-wide pulse over every puddle ---------------------------------------------------------- +/** battle → Map(tileKey → { until, ms, def, src }). */ +const SLIME = new WeakMap(); + +/** The slime puddles of a battle (tile key → puddle), for tests and the pulse. */ +export const slimeOf = (battle) => SLIME.get(battle) ?? null; + +function slimeState(battle) { + let m = SLIME.get(battle); + if (m) return m; + m = new Map(); + SLIME.set(battle, m); + // no owner: puddles outlive the unit that left them [ASSUMED] + battle.every(SLIME_IV, () => { + if (!m.size) return; + const now = battle.time; + for (const [k, p] of m) if (p.until <= now + 1e-9) m.delete(k); + if (!m.size) return; + for (const e of battle.enemies) { + // 地面敌人 only; 无视无法选择 — no targetability check (stealth, invulnerable) + if (!e.alive || e.hidden || !e.deployed || e.isFlying) continue; + let best = null; + for (const k of bodyKeys(e)) { + const p = m.get(k); + if (p && (!best || Math.abs(p.def) > Math.abs(best.def) || (Math.abs(p.def) === Math.abs(best.def) && Math.abs(p.ms) > Math.abs(best.ms)))) best = p; + } + if (!best) continue; + battle.addBuff(e, { key: SLIME_KEY, duration: SLIME_DUR, mods: { moveMul: Math.max(0, 1 + best.ms), defFlat: best.def }, source: best.src, tags: ['skill', 'slime'] }); + } + }); + return m; +} + +/** + * S2 / S3 attack.onHit (once per struck enemy, at the arrow's impact): slime on that enemy's tile for life s; a puddle + * already there is refreshed, keeping the stronger numbers [ASSUMED: one puddle per tile]. + */ +function slimeOnHit(b) { + const life = num(b['attack@projectile_life_time'], 5), ms = num(b['attack@move_speed']), def = num(b['attack@def']); + return ({ battle, unit, x, y }) => { + if (!(life > 0) || (!ms && !def)) return; + const r = Math.round(y), c = Math.round(x); + if (!battle.grid.inBounds(r, c)) return; + const m = slimeState(battle); + const k = r * COLS + c, until = battle.time + life, old = m.get(k); + if (!old) { + m.set(k, { until, ms, def, src: unit }); + battle.fx('zone', { x: c, y: r, radius: 0.5, dur: life, id: unit.id, skill: 'chen2:slime' }); + return; + } + if (Math.abs(def) > Math.abs(old.def) || (Math.abs(def) === Math.abs(old.def) && Math.abs(ms) > Math.abs(old.ms))) { + old.ms = ms; old.def = def; old.src = unit; + } + old.until = Math.max(old.until, until); + }; +} + +export default { + char_1013_chen2: (bb, chess) => { + const b1 = bbOf(chess, S1), b2 = bbOf(chess, S2), b3 = bbOf(chess, S3); + const s3 = skillRec(chess, S3); + const t0 = talentBb(chess, 0); + const t1 = (chess?.talents ?? []).filter((t) => t && t.index !== -1)[1] ?? null; + const lines = holidayLines(t1); + const waterSkill = /技能开启时,场地视为水地形/.test(String(t1?.desc ?? '')); + const frontAll = (battle, u) => num(u.profile?.frontScale, 1.5); + const spare = { + self: num(t0['e_spareshot_chen.prob'], num(t0['spareshot_chen.prob'])), + sniper: num(t0['chen2_t_002[spareshot][sniper].prob'], num(t0['spareshot_chen.prob'])), + other: num(t0['chen2_t_002[spareshot][other].prob']), + }; + const s2Charged = count(b2['attack@another_trigger_time'], 0); + return { + skills: { + [S1]: { + kind: 'ammo', + ammo: count(b1['attack@trigger_time'], 4), + mods: { atkPct: num(b1.atk) }, + attack: { dmgMul: frontAll }, + }, + [S2]: { + kind: 'ammo', + ammo: count(b2['attack@trigger_time'], 8), + mods: { atkPct: num(b2.atk) }, + attack: { onHit: slimeOnHit(b2) }, + onStart({ unit, skill }) { + // 蓄力: cast with every charge stored (activate took one) ⇒ the charged bullets; any cast spends all the SP + const charged = skill.maxCharges > 1 && skill.charges + 1 >= skill.maxCharges; + unit.mem.chen2Charged = charged; + if (charged && s2Charged > skill.ammoLeft) skill.addAmmo(s2Charged - skill.ammoLeft); + skill.charges = 0; + skill.sp = 0; + }, + onEnd({ unit }) { unit.mem.chen2Charged = false; }, + }, + [S3]: { + kind: 'ammo', + ammo: count(b3['attack@trigger_time'], 32), + mods: { atkPct: num(b3.atk) }, + targeting: s3?.rangeGrid ? { rangeGrid: s3.rangeGrid.map((p) => [p[0], p[1]]) } : undefined, + attack: { hits: 2, dmgMul: frontAll, onHit: slimeOnHit(b3) }, + // 每次攻击消耗2发: the second bullet (the engine spends the other one); with one left she still attacks + onAttack({ battle, unit, skill }) { + if (skill.ammoLeft > 1) { + skill.ammoLeft--; + battle.emit('ammoUsed', { unit, left: skill.ammoLeft, skill }); + } + }, + }, + }, + talents: [ + { install(battle, unit) { // 节约风气 + if (spare.self > 0 || spare.sniper > 0 || spare.other > 0) installSpare(battle, unit, spare); + } }, + { install(battle, unit) { // 假日余韵: +ASPD (+ATK), the water line while the field counts as water + const KEY = 'talent:chen2:holiday'; + const apply = () => { + const w = waterOn(battle); + if (unit.mem.chen2Water === w && unit.findBuff(KEY)) return; + unit.mem.chen2Water = w; + const l = w ? lines.water : lines.common; + const mods = {}; + if (l.atkPct) mods.atkPct = l.atkPct; + if (l.aspd) mods.aspd = l.aspd; + if (Object.keys(mods).length) battle.addBuff(unit, { key: KEY, mods, persist: true, allowDead: true, tags: ['talent'] }); + else battle.removeBuff(unit, KEY); + }; + apply(); + battle.on('tick', apply, { owner: unit }); + if (!waterSkill) return; + // RPR-Y stage 3 "技能开启时,场地视为水地形": the TAG while her skill runs, gone when it ends or she leaves + battle.on('skillStart', (ctx) => { if (ctx.unit === unit) { setWater(battle, unit, true); apply(); } }, { owner: unit }); + battle.on('skillEnd', (ctx) => { if (ctx.unit === unit) { setWater(battle, unit, false); apply(); } }, { owner: unit }); + battle.on('death', (ctx) => { if (ctx.unit === unit) setWater(battle, unit, false); }, { owner: unit }); + } }, + ], + }; + }, +}; diff --git a/server/sim/content/kits/ops/op-ray.js b/server/sim/content/kits/ops/op-ray.js new file mode 100644 index 00000000..efb3096f --- /dev/null +++ b/server/sim/content/kits/ops/op-ray.js @@ -0,0 +1,311 @@ +// server/sim/content/kits/ops/op-ray.js — 莱伊 (char_4117_ray) 自选 operator kit: 6★ 猎手 (狙击), an owned-6★ pick of the +// tier-5 and tier-6 自选 slots; every skill, both talents, the trait, both modules (HUN-X 《跳舞的月光》, HUN-Y 证明什么?) at +// every form, and the kit of her summon 沙地兽 (token_10034_ray_sndbst). Kit contract and the 自选 rules: ../README.md +// ("How to add an operator (自选)"). +// +// Forms (data/backups.json units.char_4117_ray): 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) — the owner's decision of 2026-10-05. Potential 0 [ASSUMED: no +// account]. Sources: character_table / skill_table / battle_equip_table / the token's character_table row (zh_CN, as +// built into backups.json) and PRTS 莱伊 (巡哨伙伴 / 入神 / S1 / S2 / S3 备注), PRTS 沙地兽 (备注 "持有禁疗、无敌", "退场时返还1 +// 个可部署的沙地兽", "莱伊退场时强制撤退场上的沙地兽"; its skill "仅在持有者携带技能2时才会携带"), PRTS 分支特性信息 猎手, BWIKI +// 莱伊 ("装填间隔即为攻击间隔,初始子弹数即为最大子弹数"), PRTS 卫戍协议/帮助 (a placed summon that leaves is deployed again on +// its tile "在满足条件后"). +// - Trait (猎手) "攻击时需要消耗子弹且攻击力提升至120%,不攻击时会缓慢地装填子弹(最多8发)" (trait bb value / atk_scale; the +// hunter profile's ×atk_scale on every bullet attack, skill attacks included). PRTS 分支特性信息 猎手: "入场时持有自身子弹上限 +// 数的子弹" — full at every deployment; "存在子弹且攻击范围内存在目标时进行攻击,不存在子弹/子弹未满且攻击范围内无目标时进行 +// 装弹,通常情况下每次装填1颗" and "装弹行为属于普通攻击行为,持续时间使用装填间隔,装填间隔默认为自身基础攻击间隔,不受攻速/ +// 攻击间隔变化影响": a reload is an action of her attack loop lasting her BASE attack time (1.6 s; ASPD never shortens it), +// loading one bullet when it ends — taken when the magazine is empty (targets or not) or not full with nobody to shoot. +// This kit's own reload (kit trait install / canAttack / afterAttack); the engine's hunter profile (1 bullet per second +// after 1 s without attacking) stays for 雪猎. Can hit air units (PRTS "可对空"), blocks 1, ground enemies target her. +// HUN-X adds "子弹数量为空时下次装填额外加装1发子弹" (trait bb extra_add): a reload begun on an empty magazine loads 1 + that. +// HUN-Y raises the trait to atk_scale 1.33 (and ASPD +5 / +7 in the stats). +// - T1 巡哨伙伴 "可以在攻击范围内部署沙地兽于25秒内侦察一片区域延伸攻击范围,自身优先攻击该区域内的目标且对其造成的物理伤害提 +// 高15%" (bb damage_scale; HUN-X stage 3: 20 % and "沙地兽的再部署时间-10秒" — the token's module stats, respawn 20 s). +// PRTS 备注: "攻击范围内" of her attacks, talents and skills means "自己或自己的召唤物的攻击范围内" — while a 沙地兽 scouts, +// the enemies of its x-4 (3×3) are in her range (Battle.setExtraRange) and in her skills' trigger range +// (skill.addTriggerRange); she picks a target of that area before any other (after the ones she blocks); her physical +// damage on an enemy there ×(1 + damage_scale) ("伤害倍率提升": DamageInfo mul). +// The 沙地兽 is a hand piece the player places in her range (data ownerRange): it deploys with the board, scouts for the +// token talent's `duration` (25 s) and then leaves [ASSUMED: the scouting ends with its stay — PRTS "退场时返还1个可部署 +// 的沙地兽"]; it is untargetable (its trait text), 无敌 and 禁疗 (PRTS 备注), makes no attack (实体类型 装置) [ASSUMED], and +// is withdrawn when 莱伊 leaves the field (PRTS 备注). A 沙地兽 that left comes back on its tile once its redeploy time +// (×(1 + S2 respawn_time) while 广域警觉 runs) has passed, paying its cost (3 DP), while 莱伊 is on the field. +// - T2 入神 "攻击相同目标时每次攻击提高自身攻击力8%,最多3层" (bb atk / max_stack_cnt; HUN-Y stage 3: 9 %, 4 layers). PRTS 备注: +// "每次攻击前:若目标与上次攻击目标不同,失去之前获得的增益;随后获得一层增益,持续时间无限" — before each attack (the special +// bullet of S1 too; never a reload), lost on a new target, gone when she leaves the field. +// - S1 脱身矢 (MANUAL, 2 charges, data DEFAULT): "立即用额外特殊子弹攻击目标,造成相当于攻击力N%的物理伤害并将其中等力度地推开, +// 若将其击倒则使下次装填额外加装1发子弹". PRTS 备注: "'额外特殊子弹'实际为无需消耗子弹的一次攻击,可受特性加成" — an attack +// at once (Battle.forceAttack; the cast's normal attack follows as usual) at atk_scale × ATK × the trait scale that takes no +// bullet; a 中力 (bb force) push along her facing, radial at 力度 −1 when the target is off it (PRTS "推动方向默认为自身朝 +// 向,因角度过大变为径向推力时,力度仅-1": the engine's directional rule with a −1 instead of −2); a kill adds bb cnt bullets +// to the next reload ("额外装填效果可叠加并于下1次装填时一同生效"). With an empty magazine (no attack to wait for) the cast +// comes as soon as an enemy is in range [ASSUMED, as 雪猎's special bullets]. The 地穴 clause has nothing to act on here. +// - S2 广域警觉 (AUTO, attack SP; 持续时间无限 — a toggle): range 4-10, ATK +atk, the 沙地兽's redeploy time ×(1 + +// respawn_time). Self / summon effects only: it fires at full SP (`trigger: 'SP_FULL'`, the owner's AUTO rule). +// Passive "沙地兽撤退时回收命中该区域的子弹": while she carries S2, the bullets of her attacks that hit an enemy inside a +// scouting 沙地兽's area are counted and come back to her magazine when it leaves (≤ the magazine, while she is on the +// field) [ASSUMED: capped at the trait's maximum]; S1's special bullet is no bullet. PRTS "装弹行为不触发攻击回复": no +// reload gives attack SP. +// - S3 “得见光芒” (MANUAL, 16 s, data ACTIVE_RANGE on its 3-8): "立即停止攻击直至子弹装满,装填间隔大幅缩短(-1.2)": at the cast +// she stops attacking and reloads (a reload under way is cut to the new interval) until her magazine is full, every reload +// while it runs lasting base attack time + reload_interval (0.4 s); range 3-8; every attack attack@atk_scale × ATK +// (× the trait scale) and 束缚 (bind) attack@unmove_duration s; a kill of hers during it ⇒ +sp SP when it ends, through +// 阻回 (PRTS 备注 "获得技力效果无视阻回"). + +import { num, talentBb, traitBb, skillRec, up } from '../shared/tier1.js'; +import { acquireTargets, effectiveProfile } from '../../../ai.js'; +import { sortEnemyTargets } from '../../../targeting.js'; +import { bodyInKeys } from '../../../body.js'; +import { PUSH_DIRECTIONAL_MIN_DIST } from '../../../constants.js'; + +const S1 = 'skchr_ray_1'; +const S2 = 'skchr_ray_2'; +const S3 = 'skchr_ray_3'; +export const SANDBEAST = 'token_10034_ray_sndbst'; +/** 巡哨伙伴 (E2): the 沙地兽's scouting when its def carries no duration (PRTS: "持续25秒"). */ +const LIFE_FALLBACK = 25; +/** Seconds between two tries of a 沙地兽 that left to come back (tile busy, DP short, 莱伊 away). */ +const RETRY = 0.25; +/** Tag of S1's special bullet (no bullet of the magazine). */ +export const SPECIAL_TAG = 'ray:special'; +const TRANCE_KEY = 'talent:ray:trance'; + +const bbOf = (chess, id) => skillRec(chess, id)?.bb ?? {}; +/** The magazine of the trait ("最多8发"). */ +const ammoMax = (unit) => Math.max(1, Math.floor(num(unit.profile?.ammoMax, 8))); +/** First talent of a normalised token def holding `key` (token talents keep no index). */ +const tokTalent = (def, key) => (def?.talents ?? []).find((t) => t && t.bb && t.bb[key] != null) ?? null; + +/** The 沙地兽's kit: no attack, 无敌, 禁疗 (its untargetability comes from its trait text, simdata normalizeToken). */ +function sandbeastKit() { + return { + skill: null, + trait: { noAttack: true }, + talents: [], + install(battle, t) { + battle.addBuff(t, { key: 'ray:sandbeast', flags: { invulnerable: true, noHeal: true }, persist: true, allowDead: true }); + }, + }; +} + +export default { + char_4117_ray: (bb, chess) => { + const b1 = bbOf(chess, S1), b2 = bbOf(chess, S2), b3 = bbOf(chess, S3); + const s2 = skillRec(chess, S2), s3 = skillRec(chess, S3); + const t0 = talentBb(chess, 0), t1 = talentBb(chess, 1); + const extraAdd = Math.max(0, Math.floor(num(traitBb(chess).extra_add))); + const picked = chess?.skill?.skillId ?? null; + const tokenId = (chess?.talents ?? []).find((t) => t && t.tokenKey)?.tokenKey ?? SANDBEAST; + + /** One reload: her base attack time, S3's reload_interval while it runs (PRTS: ASPD never changes it). */ + const reloadInterval = (unit) => { + const s3on = !!(unit.skill && unit.skill.active && unit.skill.id === S3); + return Math.max(0.05, num(unit.base?.bat, 1.6) + (s3on ? num(b3.reload_interval) : 0)); + }; + const startReload = (unit) => { + const m = unit.mem; + m.rayReloading = true; + if ((unit.trait.ammo ?? 0) <= 0 && extraAdd > 0) m.rayLoadExtra = (m.rayLoadExtra ?? 0) + extraAdd; // HUN-X + unit.atkCd = reloadInterval(unit); + }; + const finishReload = (unit) => { + const m = unit.mem; + m.rayReloading = false; + const add = 1 + Math.max(0, Math.floor(num(m.rayLoadExtra))); + m.rayLoadExtra = 0; + unit.trait.ammo = Math.min(ammoMax(unit), (unit.trait.ammo ?? 0) + add); + }; + const resetTrait = (unit) => { + unit.trait.ammo = ammoMax(unit); + Object.assign(unit.mem, { rayReloading: false, rayLoadExtra: 0, rayFill: false }); + }; + + return { + trait: { + // 猎手 (PRTS 分支特性信息): her own reload, an action of the attack loop (canAttack runs once the cooldown is over) + install(battle, unit) { + resetTrait(unit); + battle.on('deploy', (ctx) => { if (ctx.unit === unit) resetTrait(unit); }, { owner: unit }); + }, + canAttack(battle, unit) { + const m = unit.mem; + if (m.rayReloading) finishReload(unit); + const max = ammoMax(unit), ammo = unit.trait.ammo ?? 0; + if (m.rayFill) { // S3: no attack until the magazine is full + if (ammo < max) { startReload(unit); return false; } + m.rayFill = false; + } + if (ammo <= 0 || (ammo < max && !acquireTargets(battle, unit, effectiveProfile(unit)).length)) { startReload(unit); return false; } + return true; + }, + afterAttack(battle, unit) { unit.trait.ammo = Math.max(0, (unit.trait.ammo ?? 0) - 1); }, + }, + skills: { + [S1]: { + kind: num(skillRec(chess, S1)?.maxChargeTime, 1) > 1 ? 'charges' : 'instant', + // the special bullet: an attack that spends no bullet (its own afterAttack) and takes the trait scale + attack: { + atkScale: num(b1.atk_scale, 1), + tags: ['skill', SPECIAL_TAG], + afterAttack() {}, + onHit({ battle, unit, target }) { + if (!target) return; + if (!target.alive) { unit.mem.rayLoadExtra = num(unit.mem.rayLoadExtra) + Math.max(0, Math.floor(num(b1.cnt, 1))); return; } + const force = num(b1.force, 1); + const [fr, fc] = unit.fwd; + const vx = target.x - unit.x, vy = target.y - unit.y, d = Math.hypot(vx, vy); + if (d >= PUSH_DIRECTIONAL_MIN_DIST && vx * fc + vy * fr >= d * Math.SQRT1_2) battle.push(target, force, { from: unit, dir: { x: fc, y: fr }, fixed: true }); + else battle.push(target, force - 1, { from: unit }); + }, + }, + onStart({ battle, skill, unit }) { + if (battle.forceAttack(unit)) return; + // nobody to shoot after all: no cast + skill.pending = false; + skill.addCharge(1); + }, + }, + [S2]: { + kind: 'toggle', + trigger: 'SP_FULL', + mods: { atkPct: num(b2.atk) }, + targeting: s2?.rangeGrid ? { rangeGrid: s2.rangeGrid.map((p) => [p[0], p[1]]) } : undefined, + }, + [S3]: { + kind: 'duration', + targeting: s3?.rangeGrid ? { rangeGrid: s3.rangeGrid.map((p) => [p[0], p[1]]) } : undefined, + attack: { + atkScale: num(b3['attack@atk_scale'], 1), + onHit({ battle, unit, target }) { + if (target && target.alive) battle.applyStatus(target, 'bind', { duration: num(b3['attack@unmove_duration'], 2), source: unit }); + }, + }, + onStart({ unit }) { + const m = unit.mem; + m.rayFill = true; + m.rayKilled = false; + // 立即停止攻击: the reload starts now (one under way is cut to the new interval) + unit.atkCd = m.rayReloading ? Math.min(unit.atkCd, reloadInterval(unit)) : 0; + }, + onEnd({ unit, reason }) { + const m = unit.mem; + m.rayFill = false; + if (m.rayKilled && reason !== 'death' && up(unit) && unit.skill) unit.skill.gainSp(num(b3.sp), 'init'); // 无视阻回 + m.rayKilled = false; + }, + }, + }, + talents: [ + { install(battle, unit) { // 巡哨伙伴 + the 沙地兽 (and S2's bullet recovery) + const m = unit.mem; + const mine = (t) => !!t && t.kind === 'token' && t.defId === tokenId && t.ownerUnit === unit; + // her placed 沙地兽 pieces run the 沙地兽's kit (set up here, before the battle starts — as 鸿雪's 打字机) + for (const t of battle.allyUnits) { + if (!mine(t) || t.alive || t.deployed) continue; + if (t.kit) battle.offOwner(t); + battle._setupUnit(t, sandbeastKit()); + } + const ds = num(t0.damage_scale); + m.rayArea = null; + m.rayBullets = 0; + if (unit.skill) unit.skill.addTriggerRange(() => (m.rayAreaKeys ? [m.rayAreaKeys] : [])); + const endArea = () => { m.rayArea = null; m.rayAreaKeys = null; m.rayBeast = null; battle.setExtraRange(unit, null); }; + battle.on('deploy', (ctx) => { + const t = ctx.unit; + if (!mine(t)) return; + const life = num(tokTalent(t.def, 'duration')?.bb?.duration, LIFE_FALLBACK); + m.rayBeast = t; + m.rayAreaKeys = [...t.rangeKeys]; + m.rayArea = new Set(m.rayAreaKeys); + m.rayBullets = 0; + m.rayCounted = 0; + battle.setExtraRange(unit, m.rayAreaKeys); + const seq = t.deploySeq; + battle.after(life, () => { if (t.alive && t.deploySeq === seq) battle.retreat(t, { reason: 'expired', permanent: true }); }, { owner: unit }); + }, { owner: unit }); + battle.on('death', (ctx) => { + const t = ctx.unit; + if (t === unit) { // "莱伊退场时强制撤退场上的沙地兽" + for (const x of battle.allyUnits) if (mine(x) && x.alive) battle.retreat(x, { reason: 'retreat', permanent: true }); + return; + } + if (!mine(t) || battle.finished) return; + t.removed = false; // the piece stays (Battle.redeploy needs it; its hooks are kept) + if (m.rayBeast === t) endArea(); + // S2 passive: the bullets that hit in its area come back + if (picked === S2 && m.rayBullets > 0 && up(unit)) unit.trait.ammo = Math.min(ammoMax(unit), (unit.trait.ammo ?? 0) + m.rayBullets); + m.rayBullets = 0; + const left = battle.time; + battle.every(RETRY, (b, sched) => { + if (t.alive || t.removed || b.finished) { sched.cancel(); return; } + const mul = unit.skill && unit.skill.active && unit.skill.id === S2 ? Math.max(0, 1 + num(b2.respawn_time)) : 1; + if (b.time + 1e-9 < left + Math.max(0, num(t.base.respawnTime)) * mul || !up(unit)) return; + if (b.redeploy(t, { free: false })) sched.cancel(); + }, { owner: unit }); + }, { owner: unit, priority: -10 }); + // 自身优先攻击该区域内的目标 (after the enemies she blocks) + battle.on('beforeAttack', (ctx) => { + if (ctx.attacker !== unit || !m.rayArea || !ctx.targets.length) return; + const area = m.rayArea, prof = ctx.profile ?? unit.profile; + const all = battle.enemiesInKeys(unit.rangeKeys, unit, prof); + for (const e of battle.blockedTargets(unit, prof)) if (!all.includes(e)) all.push(e); + if (!all.some((e) => bodyInKeys(e, area))) return; + sortEnemyTargets(battle, unit, all, prof.priority ?? null); + const rank = (e) => (e.blockedBy === unit ? 0 : bodyInKeys(e, area) ? 1 : 2); + const order = all.map((e, i) => ({ e, i, r: rank(e) })).sort((a, b) => a.r - b.r || a.i - b.i).map((x) => x.e); + ctx.targets = order.slice(0, ctx.targets.length); + }, { owner: unit, priority: 10 }); + // ×(1 + damage_scale) on her physical damage to an enemy of the area + if (ds > 0) { + battle.on('hit', (ctx) => { + if (ctx.source !== unit || !m.rayArea || !ctx.target || ctx.target.side !== 'enemy' || ctx.dmg.type !== 'phys') return; + if (bodyInKeys(ctx.target, m.rayArea)) ctx.dmg.mul *= 1 + ds; + }, { owner: unit }); + } + // S2 passive: count the bullets of her attacks that hit an enemy of the area (one per attack) + if (picked === S2) { + battle.on('damaged', (ctx) => { + const d = ctx.dmg, e = ctx.target; + if (ctx.source !== unit || !m.rayArea || !d || !d.isAttack || !e || e.side !== 'enemy' || (d.tags && d.tags.includes(SPECIAL_TAG))) return; + if ((d.attackId && d.attackId === m.rayCounted) || !bodyInKeys(e, m.rayArea)) return; + m.rayCounted = d.attackId; + m.rayBullets++; + }, { owner: unit }); + } + } }, + { install(battle, unit) { // 入神: +atk per attack on the same target (≤ max_stack_cnt), lost on a new target + const atk = num(t1.atk), max = Math.max(1, Math.floor(num(t1.max_stack_cnt, 3))); + if (!(atk > 0)) return; + const m = unit.mem; + m.rayTrance = null; + m.rayStacks = 0; + battle.on('deploy', (ctx) => { if (ctx.unit === unit) { m.rayTrance = null; m.rayStacks = 0; } }, { owner: unit }); + battle.on('beforeAttack', (ctx) => { + const t = ctx.attacker === unit ? ctx.targets[0] : null; + if (!t) return; + if (m.rayTrance !== t) { m.rayTrance = t; m.rayStacks = 0; } + m.rayStacks = Math.min(max, m.rayStacks + 1); + battle.addBuff(unit, { key: TRANCE_KEY, mods: { atkPct: atk * m.rayStacks }, tags: ['talent'] }); + }, { owner: unit, priority: -10 }); + } }, + ], + install(battle, unit) { + // S3: 技能期间若击倒敌人 — a kill of hers while it runs + if (picked === S3) { + battle.on('kill', (ctx) => { + if (ctx.killer === unit && unit.skill && unit.skill.active && unit.skill.id === S3) unit.mem.rayKilled = true; + }, { owner: unit }); + } + // S1 with an empty magazine (the attack loop only reloads then): cast once an enemy is in range [ASSUMED] + if (picked !== S1) return; + battle.on('tick', () => { + const sk = unit.skill; + if (!up(unit) || !unit.canAct || !sk || !sk.ready || sk.pending || sk.opCooling || unit.s.flags.silence || unit.s.flags.disarm) return; + if ((unit.trait.ammo ?? 1) > 0) return; + if (acquireTargets(battle, unit, effectiveProfile(unit)).length) sk.activate('DEFAULT'); + }, { owner: unit }); + }, + }; + }, +}; diff --git a/test/content/op_ascln.test.js b/test/content/op_ascln.test.js new file mode 100644 index 00000000..11709b34 --- /dev/null +++ b/test/content/op_ascln.test.js @@ -0,0 +1,311 @@ +// test/content/op_ascln.test.js — the 自选 operator kit of 阿斯卡纶 (char_4132_ascln, 6★ 伏击客; kit +// server/sim/content/kits/ops/op-ascln.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, AMB-X +// “无形,无情” or AMB-Y “阿斯卡纶的眼睛” at stage 1 (tier 5) / 3 (tier 6). Numbers from data/backups.json; the fidelity +// checklist of kits/README.md. +// Run: node --test test/content/op_ascln.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'; +import { dreadKey, DREAD_TAG } from '../../server/sim/content/kits/ops/op-ascln.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 ASC = 'char_4132_ascln'; +const FORMS = BACKUPS.units[ASC].forms; +const SLOT = { 5: 'chess_char_5_diy1_a', 6: 'chess_char_6_diy1_a' }; +const AX = 'uniequip_002_ascln', AY = 'uniequip_003_ascln'; +const S1 = 'skchr_ascln_1', S2 = 'skchr_ascln_2', S3 = 'skchr_ascln_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_weak: dummy('enemy_weak', { hp: 10 }), + enemy_hitter: dummy('enemy_hitter', { atk: 200, range: 1.5, bat: 0.5 }), + enemy_walkslow: enemyRec({ key: 'enemy_walkslow', hp: 1e9, speed: 1, mass: 0 }), +}; +const FORMS_ALL = [[5, false, null], [6, false, null], ...[5, 6].flatMap((t) => [null, AX, AY].map((m) => [t, true, m]))]; +const label = ([tier, elite, mod]) => `T${tier} ${elite ? 'elite' : 'normal'} ${mod ?? 'none'}`; + +/** 阿斯卡纶 as uid 1 at (row, col) facing RIGHT, plus `others`. */ +function field({ tier = 5, elite = false, mod = null, skill = 0, 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', 'death', 'attack', 'heal', 'dodge'], captureNoisy: true, + units: [{ uid: 1, diy: { slot: SLOT[tier], charId: ASC, skillIndex: skill, uniEquipId: mod }, elite, row, col }, ...others], + }); + h.step(); + return { h, u: h.unit(1) }; +} +const atkHits = (h, u) => h.hooksOf('damaged').filter((c) => c.source === u && c.dmg?.isAttack); +function done(h) { + checkInvariants(h.b); + assert.equal(h.b.errors.length, 0, JSON.stringify(h.b.errors[0])); +} +/** Keep her from casting (no SP). */ +function noSkill(h, u) { + u.skill.charges = 0; u.skill.sp = 0; + h.b.addBuff(u, { key: 'test:noSp', flags: { noSp: true } }); +} + +test('阿斯卡纶 in every 自选 form: her kit (all three skills authored), the form\'s stats + module attributes, y-1, 伏击客 (melee, every enemy in range, ground only, 50 % / AMB-Y 65 % dodge, taunt level −1 — not −2), blocks 0, the data triggers; offered as a pick', () => { + assert.equal(OPERATOR_KITS[ASC], KITS[ASC]); + 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], [ASC, SLOT[tier], form.skills[skill].skillId, false, 'skills'], label(f)); + assert.deepEqual([u.base.maxHp, u.base.atk, u.base.def, u.base.res], + [form.stats.maxHp + (m?.attr.maxHp ?? 0), form.stats.atk + (m?.attr.atk ?? 0), form.stats.def + (m?.attr.def ?? 0), 30], `${label(f)}: stats`); + assert.deepEqual([u.s.blockCnt, u.profile.attack, u.profile.canHitFly, u.profile.dmgType, u.profile.allInRange, u.profile.sub, u.base.bat], + [0, 'melee', false, 'phys', true, 'stalker', 3.5], `${label(f)}: 伏击客`); + const p = mod === AY ? 0.65 : 0.5; + assert.deepEqual([u.s.dodgePhys, u.s.dodgeArts, u.s.taunt], [p, p, -1], `${label(f)}: dodge, taunt −1`); + assert.deepEqual(u.liveRangeGrid, form.rangeGrid, `${label(f)}: y-1`); + assert.equal(u.skill.rule, form.skills[skill].trigger.rule, `${label(f)}: the data's trigger`); + assert.ok(!u.s.flags.liftoff && !u.s.flags.camou && !u.s.flags.stealth && !u.s.flags.untargetable, `${label(f)}: ground enemies can target her`); + done(h); + } + } + assert.deepEqual(formOf(6, true).skills.map((s) => s.trigger.rule), ['DEFAULT', 'DEFAULT', 'ACTIVE_RANGE']); + assert.deepEqual([modOf(5, AX).attr, modOf(6, AX).attr, modOf(5, AY).attr, modOf(6, AY).attr], + [{ maxHp: 180, atk: 15 }, { maxHp: 270, atk: 53 }, { atk: 55, def: 25 }, { atk: 80, def: 60 }]); + const data = { chess: CHESS, backups: BACKUPS }; + assert.ok(KITTED_CHARS.includes(ASC) && [5, 6].every((t) => diyPool(t, { data, kitted: KITTED_CHARS }).includes(ASC))); + assert.equal(validateDiyPicks({ [SLOT[6]]: { charId: ASC, skillIndex: 2, uniEquipId: AX } }, { data, kitted: KITTED_CHARS }).ok, true); +}); + +test('trait 伏击客: one attack strikes every ground enemy of her y-1 at once (physical), never a flyer; her dodge lets 50 % (AMB-Y 65 %) of the enemy hits through as dodges', () => { + for (const [tier, elite, mod] of [[5, false, null], [6, true, AY]]) { + const { h, u } = field({ tier, elite, mod, skill: 1 }); + noSkill(h, u); + const a = h.spawn('enemy_dummy', { pos: [10, 6] }), b = h.spawn('enemy_dummy', { pos: [11, 4] }), c = h.spawn('enemy_dummy', { pos: [10, 7] }); + const fly = h.spawn('enemy_fly', { pos: [9, 5] }); + assert.ok(h.runUntil(() => atkHits(h, u).length >= 3, 6)); + const id = atkHits(h, u)[0].dmg.attackId; + const hit = atkHits(h, u).filter((x) => x.dmg.attackId === id); + assert.deepEqual(new Set(hit.map((x) => x.target)), new Set([a, b, c]), `T${tier}: every ground enemy of y-1 ([0,2] included)`); + for (const x of hit) assert.equal(x.type, 'phys'); + assert.ok(!atkHits(h, u).some((x) => x.target === fly), 'never the flyer'); + // her dodge + const hitter = h.spawn('enemy_hitter', { pos: [10, 6] }); + h.b.addBuff(u, { key: 'test:inv', mods: { defFlat: 1e6 } }); + h.run(200); + const dodged = h.hooksOf('dodge').filter((x) => x.target === u && x.source === hitter).length; + const landed = h.hooksOf('damaged').filter((x) => x.target === u && x.source === hitter).length; + const r = dodged / (dodged + landed); + assert.ok(dodged + landed > 200 && Math.abs(r - (mod === AY ? 0.65 : 0.5)) < 0.06, `T${tier}: dodge rate ${r}`); + done(h); + } +}); + +test('T1 死亡拘审: every hit of her attacks adds a layer (≤ 3, the duration reset): move ×(1 − 0.18 × layers), layers × 10 % of her current ATK as arts every second (法术持续伤害: not dodgeable) for 25 s; AMB-X stage 3: 11 %, 30 s; all of it ends the moment she leaves', () => { + for (const [tier, elite, mod] of [[5, false, null], [5, true, AX], [6, true, AX], [6, true, AY]]) { + const x3 = tier === 6 && mod === AX; + const tb = (elite ? formOf(tier, true) : formOf(tier, elite)).talents.find((t) => t.index === 0).bb; + const [ratio, dur] = x3 ? [0.11, 30] : [0.1, 25]; + if (!x3) assert.deepEqual(tb, { move_speed: -0.18, atk_ratio: 0.1, max_stack_cnt: 3, debuff_duration: 25, interval: 1 }); + else assert.deepEqual(modOf(6, AX).talentChanges.find((t) => t.talentIndex === 0).bb, { move_speed: -0.18, atk_ratio: 0.11, max_stack_cnt: 3, debuff_duration: 30, interval: 1 }); + const { h, u } = field({ tier, elite, mod, skill: 1 }); + noSkill(h, u); + const e = h.spawn('enemy_dummy', { pos: [10, 6] }); + h.b.addBuff(e, { key: 'test:dodge', mods: { dodgePhys: 1, dodgeArts: 1 } }); + const key = dreadKey(u); + // a dodged attack lands nothing and adds nothing + h.run(4); + assert.equal(e.findBuff(key), null, `${label([tier, elite, mod])}: dodged hits add no layer`); + h.b.removeBuff(e, 'test:dodge'); + const n0 = atkHits(h, u).length; + assert.ok(h.runUntil(() => atkHits(h, u).length > n0, 5)); + let b = e.findBuff(key); + assert.deepEqual([b.data.n, b.duration], [1, dur], 'one layer'); + approx(b.mods.moveMul, 0.82, 'move ×0.82'); + // its ticks: 10 % × layers of her current ATK, arts, not dodgeable + const ticks = () => h.hooksOf('damaged').filter((c) => c.source === u && c.dmg.tags?.includes(DREAD_TAG)); + h.run(1.05); + const t1 = ticks(); + assert.ok(t1.length >= 1, 'a tick'); + approx(t1[0].amount, u.s.atk * ratio * 1, `${label([tier, elite, mod])}: ${ratio * 100} % ATK × 1`); + assert.deepEqual([t1[0].type, t1[0].dmg.canDodge, t1[0].dmg.isAttack], ['arts', false, false]); + assert.ok(h.runUntil(() => e.findBuff(key)?.data.n === 3, 15), 'three layers'); + b = e.findBuff(key); + approx(b.mods.moveMul, 1 - 0.18 * 3, 'move ×0.46'); + h.run(5); + assert.equal(e.findBuff(key).data.n, 3, '≤ 3 layers'); + const last = ticks().slice(-1)[0]; + approx(last.amount, u.s.atk * ratio * 3, 'three layers tick ×3'); + approx(e.findBuff(key).timeLeft, dur, 'reset on each hit', 0.15); + // no more hits: it runs out after its duration + h.b.addBuff(u, { key: 'test:disarm', flags: { disarm: true } }); + const tLast = atkHits(h, u).filter((c) => c.target === e).slice(-1)[0].t; + h.run(tLast + dur - 0.3 - h.b.time); + assert.ok(e.findBuff(key), 'still there'); + h.run(0.6); + assert.equal(e.findBuff(key), null, `gone ${dur} s after the last hit`); + // she leaves: every layer of hers ends at once + h.b.removeBuff(u, 'test:disarm'); + h.runUntil(() => e.findBuff(key), 5); + h.b.retreat(u); + assert.equal(e.findBuff(key), null, 'ends the moment she leaves'); + done(h); + } +}); + +test('T2 噬光残影: ASPD +8; +6 more with 高台 (HIGHLAND) among the four tiles next to her — the ranged wall on her left, the forbidden rim below', () => { + for (const [row, col, high] of [[10, 5, false], [10, 3, true], [12, 6, true], [11, 5, false]]) { + const { h, u } = field({ tier: 6, elite: true, skill: 1, row, col }); + approx(u.s.aspd, 100 + 8 + (high ? 6 : 0), `(${row},${col}): ASPD`); + approx(u.s.interval, 3.5 * 100 / u.s.aspd, 'interval'); + done(h); + } + assert.deepEqual(FORMS['2/1/4/0'].talents.find((t) => t.index === 1).bb, { attack_speed: 8, attack_speed_add: 6, cnt: 1 }); +}); + +test('S1 追袭 (AUTO, 2 / 3 charges, data DEFAULT): the next attack strikes every enemy of her range twice at 130 % / 170 % ATK — two 死亡拘审 layers', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S1); + assert.deepEqual([sk.spCost, sk.initSp, sk.maxChargeTime, sk.bb.atk_scale, sk.skillType], elite ? [8, 4, 3, 1.7, 'AUTO'] : [10, 2, 2, 1.3, 'AUTO'], `T${tier}`); + const { h, u } = field({ tier, elite, skill: 0 }); + assert.deepEqual([u.skill.kind, u.skill.rule, u.skill.maxCharges], ['charges', 'DEFAULT', elite ? 3 : 2]); + const a = h.spawn('enemy_dummy', { pos: [10, 6] }), b = h.spawn('enemy_dummy', { pos: [11, 5] }); + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.activations === 1, 3), `T${tier}: cast on her next attack`); + h.step(); + const hits = atkHits(h, u).filter((c) => c.dmg.isSkill); + assert.equal(hits.length, 4, `T${tier}: 2 enemies × 2 strikes`); + for (const c of hits) approx(c.amount, u.s.atk * sk.bb.atk_scale, `T${tier}: ×${sk.bb.atk_scale}`); + assert.deepEqual([a.findBuff(dreadKey(u)).data.n, b.findBuff(dreadKey(u)).data.n], [2, 2], `T${tier}: two layers each`); + assert.equal(u.skill.charges, u.skill.maxCharges - 1, 'one charge spent'); + done(h); + } +}); + +test('S2 恩赐 (MANUAL, 35 s, data DEFAULT): ATK +50 % / +90 %; every enemy of her range — air units too (PRTS 修正) — moves ×0.7 / ×0.6; a ground enemy of her range knocked out gives one 死亡拘审 layer to the ground enemies within 1.3 of it (not flyers, not beyond)', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S2); + assert.deepEqual([sk.duration, sk.spCost, sk.initSp, sk.bb.atk, sk.bb.move_speed, sk.bb.range_radius], [35, elite ? 24 : 27, elite ? 10 : 5, elite ? 0.9 : 0.5, elite ? -0.4 : -0.3, 1.3], `T${tier}`); + const { h, u } = field({ tier, elite, skill: 1 }); + assert.deepEqual([u.skill.kind, u.skill.rule], ['duration', 'DEFAULT']); + const weak = h.spawn('enemy_weak', { pos: [10, 6] }); + h.b.addBuff(weak, { key: 'test:dodge', mods: { dodgePhys: 1 } }); + const near = h.spawn('enemy_dummy', { pos: [11, 6] }); // 1 tile from it, in her range too + const fly = h.spawn('enemy_fly', { pos: [10, 7] }); // in her range (air), 1 tile from it + const out = h.spawn('enemy_dummy', { pos: [9, 8] }); // outside her range, √5 from it + h.b.addBuff(near, { key: 'test:dodge', mods: { dodgePhys: 1 } }); + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.active, 5), `T${tier}: cast`); + approx(u.skill.timeLeft, 35, '35 s', 0.01); + approx(u.s.atk, u.base.atk * (1 + sk.bb.atk), `T${tier}: ATK`); + h.run(0.3); + for (const e of [weak, near, fly]) approx(e.findBuff('ascln:s2slow')?.mods.moveMul ?? 1, 1 + sk.bb.move_speed, `T${tier}: ${e.defId} slowed`); + assert.equal(out.findBuff('ascln:s2slow'), null, 'not outside her range'); + // the knock-out: one layer on the ground enemy next to it; the flyer and the far one get none + h.b.removeBuff(weak, 'test:dodge'); + assert.ok(h.runUntil(() => !weak.alive, 10), 'knocked out'); + assert.equal(near.findBuff(dreadKey(u))?.data.n, 1, `T${tier}: a layer on the ground enemy within 1.3`); + assert.equal(fly.findBuff(dreadKey(u)), null, 'never a flyer'); + assert.equal(out.findBuff(dreadKey(u)), null, 'not beyond 1.3'); + u.skill.extend(-999); + h.step(2); + h.run(0.5); + assert.equal(near.findBuff('ascln:s2slow'), null, `T${tier}: the slow ends with the skill`); + done(h); + } +}); + +test('S3 降临 (MANUAL, 45 s, data ACTIVE_RANGE on y-10): an enemy only on y-10 casts it; range y-10; ATK +20 %, interval 3.5 − 1.2 / 1.5 s, taunt level −1 → +1; ground enemies of her range miss 15 % / 30 % of their attacks (one roll per attack), and a miss on her or a dodge of hers heals 4 % / 5 % of her max HP', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S3); + assert.deepEqual([sk.duration, sk.spCost, sk.initSp, sk.bb.atk, sk.bb.base_attack_time, sk.bb.taunt_level, sk.bb['attack@hp_ratio'], sk.bb['attack@damage_hitrate_physical'], sk.rangeId], + [45, elite ? 49 : 53, elite ? 30 : 25, 0.2, elite ? -1.5 : -1.2, 2, elite ? 0.05 : 0.04, elite ? -0.3 : -0.15, 'y-10'], `T${tier}`); + const { h, u } = field({ tier, elite, skill: 2 }); + assert.deepEqual([u.skill.kind, u.skill.rule], ['duration', 'ACTIVE_RANGE']); + u.skill.gainSp(999); + const far = h.spawn('enemy_dummy', { pos: [12, 5] }); // [2,0]: in y-10, not in y-1 + assert.ok(h.runUntil(() => u.skill.active, 1), `T${tier}: cast for [2,0]`); + assert.deepEqual(u.liveRangeGrid, sk.rangeGrid, `T${tier}: y-10 while it runs`); + approx(u.s.atk, u.base.atk * 1.2, 'ATK +20 %'); + approx(u.s.interval, (3.5 + sk.bb.base_attack_time) * 100 / u.s.aspd, 'interval'); + assert.equal(u.s.taunt, 1, 'taunt level +1'); + h.b.kill(far, null); + // a ground hitter in her range: count its attacks before and after the 命中率 roll + const hitter = h.spawn('enemy_hitter', { pos: [10, 6] }); + h.b.addBuff(hitter, { key: 'test:dodge', mods: { dodgePhys: 1 } }); // she never kills it + const seen = new Set(), passed = new Set(); + h.b.on('hit', (c) => { if (c.source === hitter && c.dmg.isAttack) seen.add(c.dmg.attackId); }, { priority: 295 }); + h.b.on('hit', (c) => { if (c.source === hitter && c.dmg.isAttack && !c.dmg.cancel) passed.add(c.dmg.attackId); }, { priority: 280 }); + h.b.on('fatal', (c) => { if (c.unit === u) c.prevented = true; }); + h.b.addBuff(u, { key: 'test:tough', mods: { defFlat: 1e6 } }); + const heals0 = h.hooksOf('heal').filter((c) => c.target === u).length; + u.skill.extend(400); + h.run(300); + const r = 1 - passed.size / seen.size; + assert.ok(seen.size > 400 && Math.abs(r - Math.abs(sk.bb['attack@damage_hitrate_physical'])) < 0.05, `T${tier}: miss rate ${r} (${seen.size} attacks)`); + const dodges = h.hooksOf('dodge').filter((c) => c.target === u && c.source === hitter).length; + const heals = h.hooksOf('heal').filter((c) => c.target === u).length - heals0; + assert.equal(heals, (seen.size - passed.size) + dodges, `T${tier}: a heal per miss on her and per dodge`); + approx(h.hooksOf('heal').filter((c) => c.target === u).slice(-1)[0].amount, u.s.maxHp * sk.bb['attack@hp_ratio'], `T${tier}: ${sk.bb['attack@hp_ratio'] * 100} % max HP`, 1e-3); + u.skill.extend(-999); + h.step(2); + assert.deepEqual([u.s.taunt, u.liveRangeGrid], [-1, formOf(tier, elite).rangeGrid], `T${tier}: back`); + done(h); + } +}); + +test('AMB-X “无形,无情”: every enemy of her range (air too) moves ×0.8 (stages 1 and 3) — two 阿斯卡纶 with it: ×0.64 (PRTS: they stack); none without it', () => { + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const { h, u } = field({ tier, elite, mod, skill: 1 }); + noSkill(h, u); + const e = h.spawn('enemy_dummy', { pos: [10, 6] }), fly = h.spawn('enemy_fly', { pos: [9, 5] }); + h.b.addBuff(e, { key: 'test:dodge', mods: { dodgePhys: 1 } }); + h.run(0.6); + const x = elite && mod === AX; + if (x) assert.deepEqual(formOf(tier, true).modules.find((m) => m.uniEquipId === AX).talentChanges.find((t) => t.talentIndex === -1).bb, { move_speed: -0.2 }); + for (const t of [e, fly]) approx(t.findBuff(`ascln:ambx#${u.id}`)?.mods.moveMul ?? 1, x ? 0.8 : 1, `${label(f)}: ${t.defId}`); + done(h); + } + const h = makeBattle({ + defs: { enemies: ENEMIES }, timeLimit: 60, autoFinish: false, seed: 3, flags: { dpPerSec: 0 }, + units: [{ uid: 1, diy: { slot: 5, charId: ASC, skillIndex: 1, uniEquipId: AX }, elite: true, row: 10, col: 5 }, + { uid: 2, diy: { slot: 6, charId: ASC, skillIndex: 1, uniEquipId: AX }, elite: true, row: 11, col: 5 }], + }); + h.step(); + const e = h.spawn('enemy_walkslow', { pos: [10, 6] }); + h.b.addBuff(e, { key: 'test:dodge', mods: { dodgePhys: 1 } }); + h.run(0.5); + approx(e.s.moveSpeed, e.base.moveSpeed * 0.8 * 0.8, 'two AMB-X slows multiply'); + done(h); +}); + +test('AMB-Y “阿斯卡纶的眼睛”: 65 % dodge (stages 1 and 3); stage 3 adds "拥有该效果的敌人被击倒时阿斯卡纶回复10%生命" — a heal of 10 % of her max HP whoever knocks out an enemy carrying her 死亡拘审', () => { + for (const [tier, elite, mod] of [[5, true, AY], [6, true, AY], [6, true, AX], [6, false, null]]) { + const y3 = tier === 6 && mod === AY; + const { h, u } = field({ tier, elite, mod, skill: 1 }); + noSkill(h, u); + if (y3) assert.equal(modOf(6, AY).talentChanges.find((t) => t.talentIndex === 0).bb.hp_ratio, 0.1); + const e = h.spawn('enemy_dummy', { pos: [10, 6] }); + assert.ok(h.runUntil(() => e.findBuff(dreadKey(u)), 6), 'marked'); + u.hp = 100; + const h0 = h.hooksOf('heal').filter((c) => c.target === u).length; + h.b.kill(e, null); // knocked out by anybody + const heals = h.hooksOf('heal').filter((c) => c.target === u).slice(h0); + if (y3) { + assert.equal(heals.length, 1, 'one heal'); + approx(heals[0].amount, u.s.maxHp * 0.1, '10 % of her max HP'); + } else assert.equal(heals.length, 0, `${tier} ${mod}: no heal`); + // an unmarked enemy: nothing + const plain = h.spawn('enemy_dummy', { pos: [12, 8] }); + h.b.kill(plain, null); + assert.equal(h.hooksOf('heal').filter((c) => c.target === u).length - h0, y3 ? 1 : 0); + done(h); + } +}); diff --git a/test/content/op_chen2.test.js b/test/content/op_chen2.test.js new file mode 100644 index 00000000..77d4bdb2 --- /dev/null +++ b/test/content/op_chen2.test.js @@ -0,0 +1,360 @@ +// test/content/op_chen2.test.js — the 自选 operator kit of 假日威龙陈 (char_1013_chen2, 6★ 散射手; kit +// server/sim/content/kits/ops/op-chen2.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, RPR-X +// 沙滩战斗套装 or RPR-Y 假期的最后一天 at stage 1 (tier 5) / 3 (tier 6). Numbers from data/backups.json; the fidelity checklist +// of kits/README.md item by item. +// Run: node --test test/content/op_chen2.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'; +import { spareChance, waterOn, holidayLines, slimeOf, SLIME_KEY } from '../../server/sim/content/kits/ops/op-chen2.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 CHEN = 'char_1013_chen2'; +const FORMS = BACKUPS.units[CHEN].forms; +const SLOT = { 5: 'chess_char_5_diy1_a', 6: 'chess_char_6_diy1_a' }; +const RX = 'uniequip_002_chen2', RY = 'uniequip_003_chen2'; +const S1 = 'skchr_chen2_1', S2 = 'skchr_chen2_2', S3 = 'skchr_chen2_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.5, mass: 0 }), +}; +const FORMS_ALL = [[5, false, null], [6, false, null], ...[5, 6].flatMap((t) => [null, RX, RY].map((m) => [t, true, m]))]; +const label = ([tier, elite, mod]) => `T${tier} ${elite ? 'elite' : 'normal'} ${mod ?? 'none'}`; + +/** 假日威龙陈 as uid 1 at (row, col) facing RIGHT, plus `others`. */ +function field({ tier = 5, elite = false, mod = null, skill = 0, row = 10, col = 4, others = [], seed = 5, flags = {} } = {}) { + const h = makeBattle({ + defs: { enemies: ENEMIES }, timeLimit: 900, autoFinish: false, seed, + flags: { dpPerSec: 0, dpMax: 999, ...flags }, hooks: ['damaged', 'skillStart', 'skillEnd', 'ammoUsed', 'attack', 'statusApplied'], captureNoisy: true, + units: [{ uid: 1, diy: { slot: SLOT[tier], charId: CHEN, skillIndex: skill, uniEquipId: mod }, elite, row, col }, ...others], + }); + h.step(); + return { h, u: h.unit(1) }; +} +const atkHits = (h, u) => h.hooksOf('damaged').filter((c) => c.source === u && c.dmg?.isAttack); +function done(h) { + checkInvariants(h.b); + assert.equal(h.b.errors.length, 0, JSON.stringify(h.b.errors[0])); +} +/** Give the skill its SP and run until it starts. */ +function cast(h, u, max = 5) { + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.active, max), 'cast'); +} + +test('假日威龙陈 in every 自选 form: her kit (all three skills authored), the form\'s stats + module attributes (RPR-Y: cost −8), 2-5, 散射手 (every enemy in range, air too, ×1.5 / RPR-X ×1.6 on her front row), blocks 1, ground-targetable, the data triggers; offered as a pick', () => { + assert.equal(OPERATOR_KITS[CHEN], KITS[CHEN]); + 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], [CHEN, SLOT[tier], form.skills[skill].skillId, false, 'skills'], label(f)); + assert.deepEqual([u.base.maxHp, u.base.atk, u.base.def, u.base.cost], + [form.stats.maxHp + (m?.attr.maxHp ?? 0), form.stats.atk + (m?.attr.atk ?? 0), form.stats.def + (m?.attr.def ?? 0), form.stats.cost + (m?.attr.cost ?? 0)], `${label(f)}: stats`); + assert.deepEqual([u.s.blockCnt, u.profile.attack, u.profile.canHitFly, u.profile.dmgType, u.profile.allInRange, u.profile.sub, u.base.bat], + [1, 'ranged', true, 'phys', true, 'reaperrange', 2.3], `${label(f)}: 散射手`); + assert.equal(u.profile.frontScale, mod === RX ? 1.6 : 1.5, `${label(f)}: front-row scale`); + assert.deepEqual(u.profile.frontGrid, [[1, 1], [0, 0], [0, 1], [-1, 1]], `${label(f)}: the trait's front grid`); + assert.deepEqual(u.liveRangeGrid, form.rangeGrid, `${label(f)}: 2-5`); + assert.equal(u.skill.rule, form.skills[skill].trigger.rule, `${label(f)}: the data's trigger`); + 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); + } + } + assert.deepEqual(formOf(6, true).skills.map((s) => s.trigger.rule), ['DEFAULT', 'DEFAULT', 'ACTIVE_RANGE']); + assert.deepEqual([FORMS['2/1/4/0'].stats.atk, FORMS['2/60/7/1'].stats.atk, FORMS['2/1/4/0'].stats.cost], [649, 731, 32]); + assert.deepEqual([modOf(5, RX).attr, modOf(6, RX).attr, modOf(5, RY).attr, modOf(6, RY).attr], + [{ atk: 30, def: 37 }, { atk: 60, def: 45 }, { cost: -8, maxHp: 135, atk: 55 }, { cost: -8, maxHp: 180, atk: 100 }]); + const data = { chess: CHESS, backups: BACKUPS }; + assert.ok(KITTED_CHARS.includes(CHEN) && [5, 6].every((t) => diyPool(t, { data, kitted: KITTED_CHARS }).includes(CHEN))); + assert.equal(validateDiyPicks({ [SLOT[6]]: { charId: CHEN, skillIndex: 2, uniEquipId: RY } }, { data, kitted: KITTED_CHARS }).ok, true); +}); + +test('trait 散射手: one attack strikes every enemy of her 2-5 (a flyer too) — ×1.5 (RPR-X ×1.6) on the trait front row (her column ahead), ×1 elsewhere; one attackId', () => { + for (const [tier, elite, mod] of [[5, false, null], [6, true, RX], [6, true, RY]]) { + const { h, u } = field({ tier, elite, mod, skill: 1 }); + u.skill.charges = 0; u.skill.sp = 0; + h.b.addBuff(u, { key: 'test:noSp', flags: { noSp: true } }); + const front = h.spawn('enemy_dummy', { pos: [10, 5] }), up1 = h.spawn('enemy_dummy', { pos: [9, 5] }); + const far = h.spawn('enemy_dummy', { pos: [10, 6] }), fly = h.spawn('enemy_fly', { pos: [11, 6] }); + const out = h.spawn('enemy_dummy', { pos: [10, 7] }); + assert.ok(h.runUntil(() => atkHits(h, u).length >= 4, 5), 'an attack'); + const first = atkHits(h, u); + const id = first[0].dmg.attackId; + const hit = first.filter((c) => c.dmg.attackId === id); + assert.deepEqual(new Set(hit.map((c) => c.target)), new Set([front, up1, far, fly]), `T${tier}: every enemy of 2-5`); + const sc = mod === RX ? 1.6 : 1.5; + for (const c of hit) approx(c.amount, u.s.atk * ([front, up1].includes(c.target) ? sc : 1), `T${tier} ${mod}: ${c.target.tileR},${c.target.tileC}`); + assert.ok(!hit.some((c) => c.target === out), `T${tier}: [0,3] is outside 2-5`); + done(h); + } +}); + +test('S1 高压冲击 (AUTO, attack SP 6 / 5, data DEFAULT): after that many attacks ATK +55 % / +70 %, 4 bullets, every enemy of her range takes the trait multiplier; ends after 4 attacks', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S1); + assert.deepEqual([sk.spType, sk.spCost, sk.initSp, sk.bb.atk, sk.bb['attack@trigger_time'], sk.skillType], ['INCREASE_WHEN_ATTACK', elite ? 5 : 6, 0, elite ? 0.7 : 0.55, 4, 'AUTO'], `T${tier}`); + const { h, u } = field({ tier, elite, skill: 0 }); + assert.deepEqual([u.skill.kind, u.skill.rule, u.skill.spType], ['ammo', 'DEFAULT', 'attack']); + const SP = h.b.rng.chance; // no spare shots for an exact count: her own 节约风气 is tested below + h.b.rng.chance = () => false; + h.spawn('enemy_dummy', { pos: [10, 5] }); + h.spawn('enemy_dummy', { pos: [10, 6] }); + assert.ok(h.runUntil(() => u.skill.active, 60), `T${tier}: cast`); + const plain = h.hooksOf('attack').filter((c) => c.attacker === u && !c.isSkill); + assert.equal(plain.length, sk.spCost, `T${tier}: after ${sk.spCost} attacks`); + approx(u.s.atk, u.base.atk * (1 + sk.bb.atk), `T${tier}: ATK +${sk.bb.atk * 100} %`); + h.runUntil(() => !u.skill.active, 30); + h.b.rng.chance = SP; + h.run(1); // the last arrows land + const skillAttacks = h.hooksOf('attack').filter((c) => c.attacker === u && c.isSkill); + assert.equal(skillAttacks.length, 4, `T${tier}: 4 bullets, the cast's own attack the first`); + const skillHits = atkHits(h, u).filter((c) => c.dmg.isSkill); + assert.equal(skillHits.length, 8, `T${tier}: 4 attacks × 2 enemies`); + // (the last attack's arrows land after the skill ended: the engine reads the ATK at the impact) + const ids = [...new Set(skillHits.map((c) => c.dmg.attackId))]; + for (const c of skillHits.filter((x) => ids.indexOf(x.dmg.attackId) < 3)) approx(c.amount, u.base.atk * (1 + sk.bb.atk) * 1.5, `T${tier}: ×1.5 on both (the trait's front row and the tile beyond)`); + assert.equal(h.hooksOf('ammoUsed').filter((c) => c.unit === u).length, 4, `T${tier}: 4 bullets`); + approx(u.s.atk, u.base.atk, `T${tier}: ATK back`); + done(h); + } +}); + +test('S2 “堇青之夜” (MANUAL, data DEFAULT, 蓄力 2): 27 / 24 SP from 5 / 10; cast with one charge 8 bullets, ATK +50 % / +65 %; with both stored (蓄力) 20 bullets; every cast empties the SP', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S2); + assert.deepEqual([sk.spCost, sk.initSp, sk.maxChargeTime, sk.bb.atk, sk.bb['attack@trigger_time'], sk.bb['attack@another_trigger_time']], + [elite ? 24 : 27, elite ? 10 : 5, 2, elite ? 0.65 : 0.5, 8, 20], `T${tier}`); + const { h, u } = field({ tier, elite, skill: 1 }); + const atStart = []; + h.b.on('skillStart', (c) => { if (c.unit === u) atStart.push([c.skill.ammoLeft, c.skill.ammoMax, c.skill.charges, c.skill.sp, u.mem.chen2Charged]); }, { priority: -1000 }); + assert.deepEqual([u.skill.kind, u.skill.rule, u.skill.maxCharges], ['ammo', 'DEFAULT', 2]); + approx(u.skill.sp, sk.initSp, `T${tier}: initial SP`, 0.02); + // one charge and some SP towards the second: 8 bullets, everything spent + u.skill.gainSp(sk.spCost - u.skill.sp + 5); + assert.equal(u.skill.charges, 1); + approx(u.skill.sp, 5, 'SP towards the second charge'); + h.spawn('enemy_dummy', { pos: [10, 5] }); + assert.ok(h.runUntil(() => u.skill.active, 5), `T${tier}: cast`); + assert.deepEqual(atStart[0], [8, 8, 0, 0, false], `T${tier}: 8 bullets, SP emptied`); + approx(u.s.atk, u.base.atk * (1 + sk.bb.atk), `T${tier}: ATK`); + u.skill.end('test'); + // 蓄力: both charges stored + u.skill.gainSp(999, 'init'); + assert.equal(u.skill.charges, 2); + assert.ok(h.runUntil(() => u.skill.active, 10), `T${tier}: charged cast`); + assert.deepEqual(atStart[1], [20, 20, 0, 0, true], `T${tier}: 20 bullets`); + done(h); + } +}); + +test('slime (S2 / S3): each struck enemy\'s tile holds slime 5 s; a ground enemy on it moves ×0.8 / ×0.7 (S2) and loses 100 / 150 DEF (not stacking), a stealthed one too, a flyer never; it lapses after the 5 s', () => { + for (const [tier, elite, skill] of [[5, false, 1], [6, true, 1], [6, true, 2]]) { + const sk = skillOf(tier, elite, [S1, S2, S3][skill]); + const { h, u } = field({ tier, elite, skill }); + const e = h.spawn('enemy_dummy', { pos: [10, 5] }); + const fly = h.spawn('enemy_fly', { pos: [10, 6] }); + cast(h, u); + assert.ok(h.runUntil(() => atkHits(h, u).some((c) => c.dmg.isSkill && c.target === e), 5), 'struck'); + h.run(0.25); + const pud = slimeOf(h.b); + assert.ok(pud && pud.has(10 * 21 + 5) && pud.has(10 * 21 + 6), `T${tier} S${skill + 1}: puddles under both struck enemies`); + const b = e.findBuff(SLIME_KEY); + assert.ok(b, `T${tier} S${skill + 1}: the ground enemy is slimed`); + assert.deepEqual(b.mods, { moveMul: 1 + sk.bb['attack@move_speed'], defFlat: sk.bb['attack@def'] }, `T${tier} S${skill + 1}: ×${1 + sk.bb['attack@move_speed']} / ${sk.bb['attack@def']}`); + assert.equal(fly.findBuff(SLIME_KEY), null, `T${tier}: never a flyer`); + approx(e.s.def, Math.max(0, e.base.def + sk.bb['attack@def']), 'DEF'); + // 不叠加: one effect however many puddles / attacks + h.run(5); + assert.equal(e.buffs.filter((x) => x.key === SLIME_KEY).length, 1); + // a stealthed walker passing through (无视无法选择) + const w = h.spawn('enemy_dummy', { pos: [10, 5] }); + h.b.addBuff(w, { key: 'test:stealth', flags: { stealth: true } }); + h.run(0.3); + assert.ok(w.findBuff(SLIME_KEY), 'a stealthed enemy on the slime is slimed'); + // stop the skill and let the puddles run out + u.skill.end('test'); + h.b.addBuff(u, { key: 'test:disarm', flags: { disarm: true } }); + h.run(sk.bb['attack@projectile_life_time'] + 0.5); + assert.equal(e.findBuff(SLIME_KEY), null, `T${tier}: gone ${sk.bb['attack@projectile_life_time']} s after the last attack`); + assert.equal(pud.size, 0, 'no puddle left'); + done(h); + } +}); + +test('S3 “假日风暴” (MANUAL, data ACTIVE_RANGE on 2-6): an enemy only on 2-6 casts it; range 2-6 (and back); ATK +55 % / +70 %, every attack strikes twice with the trait multiplier on every enemy; 32 bullets, 2 per attack (16 attacks), one left still attacks', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S3); + assert.deepEqual([sk.spCost, sk.initSp, sk.bb.atk, sk.bb['attack@trigger_time'], sk.rangeId], [elite ? 60 : 65, elite ? 25 : 20, elite ? 0.7 : 0.55, 32, '2-6'], `T${tier}`); + const { h, u } = field({ tier, elite, skill: 2 }); + assert.deepEqual([u.skill.kind, u.skill.rule], ['ammo', 'ACTIVE_RANGE']); + const SP = h.b.rng.chance; + h.b.rng.chance = () => false; + const n0 = h.hooksOf('ammoUsed').filter((c) => c.unit === u).length; + const a0 = h.hooksOf('attack').filter((c) => c.attacker === u && c.isSkill).length; + u.skill.gainSp(999); + const corner = h.spawn('enemy_dummy', { pos: [12, 6] }); + assert.ok(h.runUntil(() => u.skill.active, 1), `T${tier}: cast for [2,2] (outside 2-5)`); + assert.deepEqual(u.liveRangeGrid, sk.rangeGrid, `T${tier}: 2-6 while it runs`); + const front = h.spawn('enemy_dummy', { pos: [10, 5] }); + h.runUntil(() => !u.skill.active, 60); + h.b.rng.chance = SP; + const attacks = h.hooksOf('attack').filter((c) => c.attacker === u && c.isSkill).length - a0; + assert.equal(attacks, 16, `T${tier}: 32 bullets / 2`); + assert.equal(h.hooksOf('ammoUsed').filter((c) => c.unit === u).length - n0, 32, `T${tier}: one ammoUsed per bullet`); + const hits = atkHits(h, u).filter((c) => c.dmg.isSkill && c.target === front); + assert.ok(hits.length >= 28, `T${tier}: two hits per attack (${hits.length})`); + const byId = new Map(); + for (const c of hits) byId.set(c.dmg.attackId, (byId.get(c.dmg.attackId) ?? 0) + 1); + assert.ok([...byId.values()].every((n) => n === 2), `T${tier}: two damage instances per attack`); + const atk = u.base.atk * (1 + sk.bb.atk); + for (const c of hits) approx(c.amount, atk * 1.5, `T${tier}: front ×1.5`); + const onCorner = atkHits(h, u).filter((c) => c.dmg.isSkill && c.target === corner); + assert.ok(onCorner.length >= 30, `T${tier}: [2,2] struck too`); + for (const c of onCorner) approx(c.amount, atk * 1.5, `T${tier}: [2,2] also ×1.5`); + assert.deepEqual(u.liveRangeGrid, formOf(tier, elite).rangeGrid, `T${tier}: back to 2-5`); + // 即使剩余弹药数小于2发仍可"消耗2发弹药"进行攻击 + h.b.on('skillStart', (c) => { if (c.unit === u) c.skill.ammoLeft = 3; }, { priority: -1000 }); + h.b.rng.chance = () => false; + const a1 = h.hooksOf('attack').filter((c) => c.attacker === u && c.isSkill).length; + u.skill.gainSp(999, 'init'); + assert.ok(h.runUntil(() => u.skill.active, 5)); + h.runUntil(() => !u.skill.active, 30); + h.b.rng.chance = SP; + assert.equal(h.hooksOf('attack').filter((c) => c.attacker === u && c.isSkill).length - a1, 2, `T${tier}: 3 bullets ⇒ 2 attacks (2 + the last one)`); + done(h); + } +}); + +test('T1 节约风气: her ammo-skill attacks spare their bullets 20 % of the time (RPR-X stage 3: 25 %) — one roll per attack, S3 spares both bullets, every ammoUsed still fires', () => { + for (const [tier, elite, mod, p] of [[5, false, null, 0.2], [5, true, RX, 0.2], [6, true, RX, 0.25], [6, true, RY, 0.2]]) { + for (const skill of [1, 2]) { + const { h, u } = field({ tier, elite, mod, skill, seed: 17 }); + h.spawn('enemy_dummy', { pos: [10, 5] }); + cast(h, u); + assert.equal(spareChance(h.b, u), p, `T${tier} ${mod}: her chance`); + u.skill.ammoLeft = 100000; + const u0 = h.hooksOf('ammoUsed').filter((c) => c.unit === u).length; + const before = new Map(); + h.b.on('attack', (c) => { if (c.attacker === u) before.set(u.stats.attacks, u.skill.ammoLeft); }, { priority: 1000 }); + const spent = []; + h.b.on('attack', (c) => { if (c.attacker === u) h.b.after(0, () => spent.push(before.get(u.stats.attacks) - u.skill.ammoLeft)); }, { priority: 1000 }); + h.run(900); + h.b.addBuff(u, { key: 'test:disarm', flags: { disarm: true } }); + h.step(3); + const per = skill === 2 ? 2 : 1; + assert.ok(spent.length > 300, `${spent.length} attacks`); + assert.ok(spent.every((n) => n === 0 || n === per), `T${tier} S${skill + 1}: 0 or ${per} per attack`); + const r = spent.filter((n) => n === 0).length / spent.length; + assert.ok(Math.abs(r - p) < 0.05, `T${tier} ${mod} S${skill + 1}: spare rate ${r} ≈ ${p}`); + const used = h.hooksOf('ammoUsed').filter((c) => c.unit === u).length - u0; + assert.equal(used, spent.length * per, `T${tier} S${skill + 1}: every bullet's ammoUsed fires, spared or not`); + done(h); + } + } +}); + +test('T1 节约风气 on others while she is on the field: another 【狙击】 operator\'s 弹药类技能 20 % (PRTS 修正 over the text\'s 10 %; RPR-X stage 3 too), another 远程 operator\'s 0 % / 12 % (RPR-X stage 3), never a 技能 without "攻击装有X发" nor a summon; none once she leaves; the highest of two 假日威龙陈', () => { + const t0 = FORMS['2/1/4/0'].talents.find((t) => t.index === 0); + assert.deepEqual(t0.bb, { 'spareshot_chen.prob': 0.2, prob: 0.1 }, 'the base row: 20 % / the text\'s 10 %'); + assert.deepEqual(modOf(6, RX).talentChanges[0].bb, { 'e_spareshot_chen.prob': 0.25, 'chen2_t_002[spareshot][other].prob': 0.12, 'chen2_t_002[spareshot][sniper].prob': 0.2 }); + for (const [tier, elite, mod, sniper, other] of [[5, false, null, 0.2, 0], [5, true, RX, 0.2, 0], [6, true, RX, 0.2, 0.12], [6, true, RY, 0.2, 0]]) { + const others = [ + { uid: 2, chessId: 'chess_char_1_01_a', row: 11, col: 3 }, // 隐现 (狙击): S2 "攻击装有14发弹药" + { uid: 3, chessId: 'chess_char_5_03_a', row: 12, col: 3 }, // 烛煌 (术师, 远程): S3 "攻击装有18发弹药" + { uid: 4, chessId: 'chess_char_5_08_a', skillIndex: 1, row: 9, col: 7 }, // 号角 (重装): S2 "技能拥有10枚弹药" — no 攻击装有 + ]; + const { h, u } = field({ tier, elite, mod, skill: 0, others }); + const inside = h.unit(2), blaze = h.unit(3), horn = h.unit(4); + assert.equal(spareChance(h.b, inside), sniper, `${tier} ${mod}: 狙击`); + assert.equal(spareChance(h.b, blaze), other, `${tier} ${mod}: 远程`); + assert.equal(spareChance(h.b, horn), 0, `${tier} ${mod}: 地面`); + // the roll only applies to a running 弹药类技能 (whose text says 攻击装有X发…) + for (const x of [inside, blaze]) assert.match(x.skill.def.description, /攻击装有\d+发/); + assert.doesNotMatch(horn.skill.def.description, /攻击装有\d+发/); + // 隐现's S2 over many attacks + h.spawn('enemy_dummy', { pos: [11, 5] }); + inside.skill.gainSp(999); + assert.ok(h.runUntil(() => inside.skill.active, 10), '隐现 casts'); + inside.skill.ammoLeft = 100000; + let spared = 0, n = 0; + h.b.on('attack', (c) => { + if (c.attacker !== inside) return; + const left = inside.skill.ammoLeft; + h.b.after(0, () => { n++; if (inside.skill.ammoLeft === left) spared++; }); + }, { priority: 1000 }); + h.run(500); + h.b.addBuff(inside, { key: 'test:disarm', flags: { disarm: true } }); + h.step(3); + assert.ok(n > 200, `${n} attacks`); + assert.ok(Math.abs(spared / n - sniper) < 0.06, `T${tier} ${mod}: 隐现 ${spared}/${n} ≈ ${sniper}`); + // she leaves: nobody's chance + h.b.retreat(u); + assert.deepEqual([spareChance(h.b, inside), spareChance(h.b, blaze)], [0, 0], 'only while she is on the field'); + done(h); + } + // two 假日威龙陈 (a shared field): each takes the highest — the RPR-X stage-3 one gives the other 20 % (≥ her own 20 %) + const h = makeBattle({ + defs: { enemies: ENEMIES }, timeLimit: 60, autoFinish: false, seed: 3, flags: { dpPerSec: 0 }, + units: [{ uid: 1, diy: { slot: 6, charId: CHEN, skillIndex: 0, uniEquipId: RX }, elite: true, row: 10, col: 4 }, + { uid: 2, diy: { slot: 5, charId: CHEN, skillIndex: 0, uniEquipId: null }, elite: false, row: 11, col: 4 }, + { uid: 3, chessId: 'chess_char_5_03_a', row: 12, col: 3 }], + }); + h.step(); + assert.deepEqual([spareChance(h.b, h.unit(1)), spareChance(h.b, h.unit(2)), spareChance(h.b, h.unit(3))], [0.25, 0.2, 0.12]); + done(h); +}); + +test('T2 假日余韵: ASPD +8 (no level of the mode has the water TAG); RPR-Y stage 3: ATK +15 % ASPD +12, and while her skill runs the field counts as water: ATK +28 % ASPD +20 — for every 假日威龙陈 of the field — until it ends', () => { + // the two rows of the data: base [map] = the step (8 + 4 = 12), module [map] = the totals (20 / 28 %), as their texts say + const base = FORMS['2/1/4/0'].talents.find((t) => t.index === 1); + assert.match(base.desc, /改为攻击速度\+12/); + assert.deepEqual(holidayLines(base), { common: { atkPct: 0, aspd: 8 }, water: { atkPct: 0, aspd: 12 } }); + const row = modOf(6, RY).talentChanges[0]; + assert.match(row.desc, /改为攻击力\+28%,攻击速度\+20,技能开启时,场地视为水地形/); + assert.deepEqual(holidayLines({ ...row, fromModule: true }), { common: { atkPct: 0.15, aspd: 12 }, water: { atkPct: 0.28, aspd: 20 } }); + assert.deepEqual(modOf(5, RY).talentChanges, [], 'RPR-Y stage 1 changes no talent'); + for (const f of FORMS_ALL) { + const [tier, elite, mod] = f; + const y3 = elite && mod === RY && tier === 6; + const { h, u } = field({ tier, elite, mod, skill: 2, others: [{ uid: 2, diy: { slot: 5, charId: CHEN, skillIndex: 0 }, row: 12, col: 4 }] }); + const mate = h.unit(2); + approx(u.s.aspd, 100 + (elite ? (modOf(tier, mod)?.attr.aspd ?? 0) : 0) + (y3 ? 12 : 8), `${label(f)}: ASPD`); + approx(u.s.atk, u.base.atk * (y3 ? 1.15 : 1), `${label(f)}: ATK`); + assert.equal(waterOn(h.b), false); + h.spawn('enemy_dummy', { pos: [10, 5] }); + cast(h, u); + h.step(); + assert.equal(waterOn(h.b), y3, `${label(f)}: water while her skill runs`); + approx(u.s.aspd, 100 + (y3 ? 20 : 8), `${label(f)}: ASPD during the skill`); + approx(u.s.atk, u.base.atk * (1 + skillOf(tier, elite, S3).bb.atk + (y3 ? 0.28 : 0)), `${label(f)}: ATK during the skill`); + approx(mate.s.aspd, 100 + (y3 ? 12 : 8), `${label(f)}: the other 假日威龙陈 (no module) gets the water line too`); + u.skill.end('test'); + h.step(); + assert.equal(waterOn(h.b), false, `${label(f)}: the TAG ends with the skill`); + approx(u.s.aspd, 100 + (y3 ? 12 : 8), `${label(f)}: back`); + approx(mate.s.aspd, 108, `${label(f)}: the other back to +8`); + if (y3) { + cast(h, u); + h.step(); + assert.equal(waterOn(h.b), true); + h.b.retreat(u); + h.step(); + assert.equal(waterOn(h.b), false, 'cleared when she leaves'); + } + done(h); + } +}); diff --git a/test/content/op_ray.test.js b/test/content/op_ray.test.js new file mode 100644 index 00000000..a40d3cd0 --- /dev/null +++ b/test/content/op_ray.test.js @@ -0,0 +1,371 @@ +// test/content/op_ray.test.js — the 自选 operator kit of 莱伊 (char_4117_ray, 6★ 猎手; kit +// server/sim/content/kits/ops/op-ray.js) and of her summon 沙地兽 (token_10034_ray_sndbst), fielded the production way (a DIY +// slot + its `diy` pick, simdata getDiy; the 沙地兽 as the placed hand piece of her player) in every form: tiers 5 / 6, +// normal (E2 Lv1, skill rank 4, no module) and elite (E2 Lv60, rank 7) with no module, HUN-X 《跳舞的月光》 or HUN-Y 证明什么? +// at stage 1 (tier 5) / 3 (tier 6). Numbers from data/backups.json; the fidelity checklist of kits/README.md. +// Run: node --test test/content/op_ray.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'; +import { SANDBEAST, SPECIAL_TAG } from '../../server/sim/content/kits/ops/op-ray.js'; +import { PUSH_TILES } from '../../server/sim/constants.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 RAY = 'char_4117_ray'; +const FORMS = BACKUPS.units[RAY].forms; +const TOKREC = BACKUPS.tokens[SANDBEAST]; +const SLOT = { 5: 'chess_char_5_diy1_a', 6: 'chess_char_6_diy1_a' }; +const HX = 'uniequip_002_ray', HY = 'uniequip_003_ray'; +const S1 = 'skchr_ray_1', S2 = 'skchr_ray_2', S3 = 'skchr_ray_3'; +const statusOf = (tier, elite) => (elite ? (tier === 5 ? '2/60/7/1' : '2/60/7/3') : '2/1/4/0'); +const formOf = (tier, elite) => FORMS[statusOf(tier, elite)]; +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); +/** The 沙地兽's variant of a form, with the pick's module (getDiyToken). */ +const tokOf = (tier, elite, mod) => { + const v = TOKREC.variants[`${RAY}@${statusOf(tier, elite)}`]; + return mod && v.byModule?.[mod] ? { ...v, ...v.byModule[mod] } : v; +}; +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_weak: dummy('enemy_weak', { hp: 10 }), + enemy_atk: dummy('enemy_atk', { atk: 500, range: 2 }), +}; +const FORMS_ALL = [[5, false, null], [6, false, null], ...[5, 6].flatMap((t) => [null, HX, HY].map((m) => [t, true, m]))]; +const label = ([tier, elite, mod]) => `T${tier} ${elite ? 'elite' : 'normal'} ${mod ?? 'none'}`; + +/** 莱伊 as uid 1 at (row, col) facing RIGHT; `beast` = the 沙地兽 piece's tile (uid 2) or null. */ +function field({ tier = 5, elite = false, mod = null, skill = 0, row = 10, col = 3, beast = null, beastFirst = false, others = [], seed = 5, flags = {} } = {}) { + const op = { uid: 1, diy: { slot: SLOT[tier], charId: RAY, skillIndex: skill, uniEquipId: mod }, elite, row, col }; + const piece = beast ? [{ uid: 2, kind: 'token', tokenId: SANDBEAST, ownerUid: 1, row: beast[0], col: beast[1] }] : []; + const h = makeBattle({ + defs: { enemies: ENEMIES }, timeLimit: 900, autoFinish: false, seed, + flags: { dpPerSec: 0, dpMax: 999, ...flags }, hooks: ['damaged', 'skillStart', 'skillEnd', 'statusApplied', 'death', 'deploy', 'attack', 'kill'], captureNoisy: true, + units: beastFirst ? [...piece, op, ...others] : [op, ...piece, ...others], + }); + h.step(); + return { h, u: h.unit(1), t: h.b.allyUnits.find((a) => a.kind === 'token' && a.defId === SANDBEAST) ?? null }; +} +const atkHits = (h, u) => h.hooksOf('damaged').filter((c) => c.source === u && c.dmg?.isAttack); +function done(h) { + checkInvariants(h.b); + assert.equal(h.b.errors.length, 0, JSON.stringify(h.b.errors[0])); +} +/** Record (time, ammo) every time her magazine changes. */ +function ammoLog(h, u) { + const log = []; + let last = u.trait.ammo; + h.b.on('tick', () => { if (u.trait.ammo !== last) { log.push([h.b.time, u.trait.ammo]); last = u.trait.ammo; } }); + return log; +} + +test('莱伊 in every 自选 form: her kit (all three skills authored), the form\'s stats + module attributes, 4-9, 猎手 (ranged physical, hits air, 8 bullets, ×1.2 / HUN-Y ×1.33), blocks 1, ground-targetable, the triggers (S2 at full SP); offered as a pick', () => { + assert.equal(OPERATOR_KITS[RAY], KITS[RAY]); + 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], [RAY, SLOT[tier], form.skills[skill].skillId, false, 'skills'], label(f)); + assert.deepEqual([u.base.maxHp, u.base.atk, u.base.def, u.base.aspd], + [form.stats.maxHp + (m?.attr.maxHp ?? 0), form.stats.atk + (m?.attr.atk ?? 0), form.stats.def + (m?.attr.def ?? 0), 100 + (m?.attr.aspd ?? 0)], `${label(f)}: stats`); + assert.deepEqual([u.s.blockCnt, u.profile.attack, u.profile.canHitFly, u.profile.dmgType, u.profile.sub, u.base.bat, u.profile.ammoMax, u.profile.ammoScale, u.trait.ammo], + [1, 'ranged', true, 'phys', 'hunter', 1.6, 8, mod === HY ? 1.33 : 1.2, 8], `${label(f)}: 猎手`); + assert.deepEqual(u.liveRangeGrid, form.rangeGrid, `${label(f)}: 4-9`); + assert.equal(u.skill.rule, skill === 1 ? 'SP_FULL' : form.skills[skill].trigger.rule, `${label(f)}: trigger`); + assert.ok(!u.s.flags.liftoff && !u.s.flags.camou && !u.s.flags.stealth, `${label(f)}: ground enemies target her`); + done(h); + } + } + assert.deepEqual(formOf(6, true).skills.map((s) => s.trigger.rule), ['DEFAULT', 'DEFAULT', 'ACTIVE_RANGE']); + assert.deepEqual([modOf(5, HX).attr, modOf(6, HX).attr, modOf(5, HY).attr, modOf(6, HY).attr], + [{ maxHp: 150, atk: 50, def: 15 }, { maxHp: 200, atk: 70, def: 25 }, { maxHp: 100, atk: 60, aspd: 5 }, { maxHp: 200, atk: 75, aspd: 7 }]); + const data = { chess: CHESS, backups: BACKUPS }; + assert.ok(KITTED_CHARS.includes(RAY) && [5, 6].every((t) => diyPool(t, { data, kitted: KITTED_CHARS }).includes(RAY))); + assert.equal(validateDiyPicks({ [SLOT[5]]: { charId: RAY, skillIndex: 1, uniEquipId: HX } }, { data, kitted: KITTED_CHARS }).ok, true); +}); + +test('trait 猎手: 8 bullets, one per attack at ×1.2 (HUN-Y ×1.33); empty ⇒ a reload of her BASE attack time (1.6 s, ASPD +100 changes nothing) loads one bullet; HUN-X loads one more onto an empty magazine; with nobody to shoot she reloads to full and stops', () => { + for (const [tier, elite, mod] of [[5, false, null], [5, true, HX], [6, true, HX], [6, true, HY]]) { + const { h, u } = field({ tier, elite, mod, skill: 1 }); + u.skill.sp = 0; + h.b.addBuff(u, { key: 'test:noSp', flags: { noSp: true } }); + h.b.addBuff(u, { key: 'test:fast', mods: { aspd: 100 } }); + const log = ammoLog(h, u); + const e = h.spawn('enemy_dummy', { pos: [10, 5] }); + assert.ok(h.runUntil(() => u.trait.ammo === 0, 20), `${mod}: the magazine runs out`); + assert.equal(h.hooksOf('attack').filter((c) => c.attacker === u).length, 8, `${mod}: 8 shots`); + h.run(0.3); // the last arrow lands (the reload has begun meanwhile) + const hits = atkHits(h, u); + assert.equal(hits.length, 8); + const sc = mod === HY ? 1.33 : 1.2; + // (入神 adds +8 % / +9 % per attack on the same target; the first shot has one layer) + const t1 = (mod === HY && tier === 6) ? 0.09 : 0.08; + approx(hits[0].amount, u.base.atk * (1 + t1) * sc, `${mod}: ×${sc}`); + const iv = u.s.interval; + approx(iv, 1.6 * 100 / (u.base.aspd + 100), 'ASPD +100 shortens her attacks'); + // empty with a target: each reload (after the attack cooldown) loads, and she shoots at once — HUN-X: two bullets + const hx = elite && mod === HX; + assert.ok(h.runUntil(() => h.hooksOf('attack').filter((c) => c.attacker === u).length >= 12, 30), 'more shots'); + const ts = h.hooksOf('attack').filter((c) => c.attacker === u).map((c) => c.t); + for (let i = 1; i < 8; i++) approx(ts[i] - ts[i - 1], iv, `${mod}: the magazine at ${iv.toFixed(2)} s`, 0.05); + approx(ts[8] - ts[7], iv + 1.6, `${mod}: cooldown + a 1.6 s reload (never shortened)`, 0.05); + if (hx) { + approx(ts[9] - ts[8], iv, 'HUN-X: the second bullet of that reload', 0.05); + approx(ts[10] - ts[9], iv + 1.6, 'then a reload again', 0.05); + } else { + approx(ts[9] - ts[8], iv + 1.6, `${mod}: one bullet per reload`, 0.05); + } + // nobody to shoot: one bullet per 1.6 s up to 8, then nothing + h.b.kill(e, null); + const n0 = log.length; + h.run(20); + const reloads = log.slice(n0); + assert.equal(reloads[reloads.length - 1][1], 8, `${mod}: full`); + for (let i = 1; i < reloads.length; i++) approx(reloads[i][0] - reloads[i - 1][0], 1.6, `${mod}: one bullet per 1.6 s`, 0.03); + const tFull = reloads[reloads.length - 1][0]; + assert.ok(h.b.time - tFull > 5 && u.trait.ammo === 8, 'stops at 8'); + done(h); + } +}); + +test('莱伊 shoots air units (猎手 "可对空"): a flyer in her range is her target; physical arrows', () => { + for (const [tier, elite, mod] of [[5, false, null], [6, true, HY]]) { + const { h, u } = field({ tier, elite, mod, skill: 1 }); + u.skill.sp = 0; + h.b.addBuff(u, { key: 'test:noSp', flags: { noSp: true } }); + const fly = h.spawn('enemy_fly', { pos: [10, 6] }); + h.run(3); + const hits = atkHits(h, u).filter((c) => c.target === fly); + assert.ok(hits.length >= 1 && hits.every((c) => c.type === 'phys'), `T${tier}: the flyer is shot`); + done(h); + } +}); + +test('T2 入神: +8 % ATK per attack on the same target, ≤ 3 layers (HUN-Y stage 3: +9 %, ≤ 4), lost on a new target (one layer again)', () => { + for (const [tier, elite, mod] of [[5, false, null], [5, true, HY], [6, true, HY], [6, true, HX]]) { + const y3 = tier === 6 && mod === HY; + const [per, max] = y3 ? [0.09, 4] : [0.08, 3]; + const t1 = (mod ? formOf(tier, true) : formOf(tier, elite)).talents.find((t) => t.index === 1).bb; + if (!y3) assert.deepEqual(t1, { atk: 0.08, max_stack_cnt: 3 }); + const { h, u } = field({ tier, elite, mod, skill: 1 }); + u.skill.sp = 0; + h.b.addBuff(u, { key: 'test:noSp', flags: { noSp: true } }); + const atks = []; + h.b.on('damaged', (c) => { if (c.source === u && c.dmg.isAttack) atks.push([c.target, u.s.atk]); }, { priority: -100 }); + const a = h.spawn('enemy_dummy', { pos: [10, 5] }); + h.runUntil(() => atks.length >= 6, 20); + for (let i = 0; i < 6; i++) approx(atks[i][1], u.base.atk * (1 + per * Math.min(max, i + 1)), `${label([tier, elite, mod])}: attack ${i + 1}`); + h.b.kill(a, null); + const b = h.spawn('enemy_dummy', { pos: [10, 6] }); + const n = atks.length; + h.runUntil(() => atks.length >= n + 1, 20); + assert.equal(atks[n][0], b); + approx(atks[n][1], u.base.atk * (1 + per), 'a new target: one layer'); + done(h); + } +}); + +test('S1 脱身矢 (MANUAL, 2 charges, data DEFAULT): a special bullet at once (no bullet of the magazine) for 290 % / 360 % × the trait scale, pushed 中力 along her facing; off her facing radial at 力度 −1; a kill loads one more bullet at the next reload; with an empty magazine it still fires', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S1); + assert.deepEqual([sk.spCost, sk.initSp, sk.maxChargeTime, sk.bb.atk_scale, sk.bb.force, sk.bb.cnt], elite ? [12, 10, 2, 3.6, 1, 1] : [14, 10, 2, 2.9, 1, 1], `T${tier}`); + // straight ahead: pushed along +x + { + const { h, u } = field({ tier, elite, skill: 0, row: 11 }); + assert.deepEqual([u.skill.kind, u.skill.rule, u.skill.maxCharges], ['charges', 'DEFAULT', 2]); + const atkAt = []; + h.b.on('damaged', (c) => { if (c.source === u) atkAt.push([c, u.s.atk]); }, { priority: -100 }); + const e = h.spawn('enemy_dummy', { pos: [11, 5] }); + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.activations === 1, 3), `T${tier}: cast`); + const ammo0 = u.trait.ammo; + h.run(0.6); + const special = atkAt.filter(([c]) => c.dmg.tags?.includes(SPECIAL_TAG)); + assert.equal(special.length, 1, `T${tier}: one special bullet`); + const [c, atk] = special[0]; + approx(c.amount, atk * sk.bb.atk_scale * 1.2, `T${tier}: ${sk.bb.atk_scale * 100} % × 1.2`); + assert.deepEqual([c.type, c.dmg.isSkill, c.dmg.isAttack], ['phys', true, true]); + assert.equal(ammo0, 7, `T${tier}: the cast's normal attack took one bullet, the special one none`); + approx(e.x, 5 + PUSH_TILES[1], `T${tier}: pushed ${PUSH_TILES[1]} tiles along her facing`, 0.03); + approx(e.y, 11, 'no sideways push'); + done(h); + } + // beside her (90° off): radial, 力度 −1 (中力 − 1 = level 0 on a weight-0 enemy — the wall stops it at 8.5) + { + const { h, u } = field({ tier, elite, skill: 0, row: 11 }); + const e = h.spawn('enemy_dummy', { pos: [10, 3] }); + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.activations === 1, 3)); + h.run(0.6); + approx(e.x, 3, 'no forward push'); + assert.ok(10 - e.y > 1, `T${tier}: radial at level 0 (${(10 - e.y).toFixed(2)} tiles, the engine's −2 would be ${PUSH_TILES[-1] ?? 0.44})`); + done(h); + } + // a kill: +1 bullet at the next reload; an empty magazine: the cast still comes + { + const { h, u } = field({ tier, elite, skill: 0 }); + u.trait.ammo = 0; + const log = ammoLog(h, u); + h.spawn('enemy_weak', { pos: [10, 5] }); + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.activations === 1, 1), `T${tier}: cast with an empty magazine`); + h.run(0.6); + assert.equal(h.hooksOf('kill').filter((k) => k.killer === u).length, 1, 'the special bullet killed it'); + assert.equal(u.trait.ammo, 0, 'no bullet spent, none loaded yet'); + assert.ok(h.runUntil(() => u.trait.ammo > 0, 5)); + assert.equal(log[log.length - 1][1], 2, `T${tier}: 1 + 1 bullets`); + done(h); + } + } +}); + +test('S2 广域警觉 (AUTO, attack SP 16): on at full SP — no enemy needed beyond the attacks that fill it — for good: range 4-10, ATK +60 % / +90 %', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S2); + assert.deepEqual([sk.skillType, sk.spType, sk.spCost, sk.bb.atk, sk.bb.respawn_time, sk.rangeId], ['AUTO', 'INCREASE_WHEN_ATTACK', 16, elite ? 0.9 : 0.6, elite ? -0.3 : -0.2, '4-10'], `T${tier}`); + const { h, u } = field({ tier, elite, skill: 1 }); + assert.deepEqual([u.skill.kind, u.skill.rule], ['toggle', 'SP_FULL']); + const e = h.spawn('enemy_dummy', { pos: [10, 5] }); + assert.ok(h.runUntil(() => u.skill.active, 120), `T${tier}: on`); + assert.equal(h.hooksOf('attack').filter((c) => c.attacker === u).length, 16, `T${tier}: after 16 attacks (reloads give no SP)`); + assert.deepEqual(u.liveRangeGrid, sk.rangeGrid, `T${tier}: 4-10`); + approx(u.s.atk, u.base.atk * (1 + sk.bb.atk + u.mem.rayStacks * 0.08), `T${tier}: ATK (with 入神's layers)`); + h.b.kill(e, null); + h.run(200); + assert.ok(u.skill.active, `T${tier}: 持续时间无限`); + // an enemy two tiles above her: only 4-10 reaches it + const top = h.spawn('enemy_dummy', { pos: [12, 3] }); + h.run(3); + assert.ok(atkHits(h, u).some((c) => c.target === top), `T${tier}: [2,0] of 4-10`); + done(h); + } +}); + +test('S3 “得见光芒” (MANUAL, 16 s, data ACTIVE_RANGE on 3-8): an enemy only on 3-8 casts it; no attack until the magazine is full, reloading every 0.4 s (1.6 − 1.2); range 3-8; attacks 230 % / 270 % × 1.2 and 束缚 2 s; a kill during it ⇒ +10 SP at its end, through 阻回', () => { + for (const [tier, elite] of [[5, false], [6, true]]) { + const sk = skillOf(tier, elite, S3); + assert.deepEqual([sk.duration, sk.spCost, sk.initSp, sk.bb.reload_interval, sk.bb['attack@atk_scale'], sk.bb['attack@unmove_duration'], sk.bb.sp, sk.rangeId], + [16, elite ? 33 : 37, elite ? 20 : 15, -1.2, elite ? 2.7 : 2.3, 2, 10, '3-8'], `T${tier}`); + const { h, u } = field({ tier, elite, skill: 2 }); + assert.deepEqual([u.skill.kind, u.skill.rule], ['duration', 'ACTIVE_RANGE']); + u.trait.ammo = 2; + const log = ammoLog(h, u); + u.skill.gainSp(999); + const side = h.spawn('enemy_dummy', { pos: [11, 6] }); // [1,3]: in 3-8, not in 4-9 + assert.ok(h.runUntil(() => u.skill.active, 1), `T${tier}: cast for [1,3]`); + assert.deepEqual(u.liveRangeGrid, sk.rangeGrid, `T${tier}: 3-8 while it runs`); + const tCast = h.b.time; + const attacksAfter = () => h.hooksOf('attack').filter((c) => c.attacker === u && c.t > tCast - 1e-9); + assert.ok(h.runUntil(() => attacksAfter().length > 0, 5), 'attacks once full'); + // 2 → 8 one bullet every 0.4 s, the first attack on the reload that fills it (the log sees 3 … 7, then 7 after that shot) + const fills = log.filter((x) => x[0] > tCast - 1e-9); + assert.deepEqual(fills.map((x) => x[1]), [3, 4, 5, 6, 7], `T${tier}: one at a time`); + for (let i = 1; i < fills.length; i++) approx(fills[i][0] - fills[i - 1][0], 0.4, `T${tier}: a reload every 0.4 s`, 0.05); + approx(attacksAfter()[0].t - fills[fills.length - 1][0], 0.4, `T${tier}: the 8th bullet, then the shot`, 0.05); + assert.equal(u.trait.ammo, 7, `T${tier}: full when it shot`); + const atkAt = []; + h.b.on('damaged', (c) => { if (c.source === u && c.dmg.isAttack) atkAt.push([c, u.s.atk]); }, { priority: -100 }); + h.run(4); + assert.ok(atkAt.length >= 2, `T${tier}: attacks once full`); + for (const [c, atk] of atkAt) approx(c.amount, atk * sk.bb['attack@atk_scale'] * 1.2, `T${tier}: ${sk.bb['attack@atk_scale'] * 100} % × 1.2`); + const binds = h.hooksOf('statusApplied').filter((c) => c.source === u && c.status === 'bind' && c.target === side); + assert.ok(binds.length >= 2 && binds.every((c) => Math.abs(c.duration - 2) < 1e-6), `T${tier}: 束缚 2 s on each hit`); + // a kill during it: +10 SP at its end, through 阻回 + const weak = h.spawn('enemy_weak', { pos: [10, 4] }); + h.runUntil(() => !weak.alive, 10); + h.b.addBuff(u, { key: 'test:noSp', flags: { noSp: true } }); + h.runUntil(() => !u.skill.active, 20); + approx(u.skill.sp, sk.bb.sp, `T${tier}: +${sk.bb.sp} SP at the end`, 0.01); + assert.deepEqual(u.liveRangeGrid, formOf(tier, elite).rangeGrid, `T${tier}: back to 4-9`); + done(h); + } +}); + +test('沙地兽 (her placed piece): untargetable, 无敌, 禁疗, no attack; while it scouts (25 s) the enemies of its 3×3 are in her range and her skill trigger range, she shoots them first, ×1.15 (HUN-X stage 3: ×1.2) physical; then it leaves, and comes back on its tile after 30 s (HUN-X stage 3: 20 s) paying 3 DP', () => { + for (const [tier, elite, mod, ds, resp] of [[5, false, null, 0.15, 30], [5, true, HX, 0.15, 30], [6, true, HX, 0.2, 20], [6, true, HY, 0.15, 30]]) { + for (const beastFirst of [false, true]) { + const { h, u, t } = field({ tier, elite, mod, skill: 2, beast: [10, 6], beastFirst }); + assert.ok(t && t.alive && t.deployed, `${mod}: deployed with the board`); + assert.equal(t.ownerUnit, u); + assert.deepEqual([t.base.respawnTime, t.base.cost, t.s.blockCnt], [tokOf(tier, elite, mod).stats.respawnTime, 3, 0], `${mod}: its stats`); + assert.equal(t.base.respawnTime, resp); + assert.ok(t.s.flags.untargetable && t.s.flags.invulnerable && t.s.flags.noHeal && t.profile.noAttack, `${mod}: untargetable, 无敌, 禁疗, no attack`); + assert.equal(t.kit.skill, null, 'no skill of its own'); + // its area: in her range (and the trigger range of her skill) + const away = h.spawn('enemy_dummy', { pos: [11, 7] }); // [1,4] of hers: outside 4-9 (and 3-8), inside its 3×3 + assert.ok(u.rangeKeySet.has(11 * 21 + 7), 'in her range'); + u.skill.gainSp(999); + assert.ok(h.runUntil(() => u.skill.active, 1), `${mod}: S3 cast for an enemy of the area only`); + u.skill.end('test'); + u.skill.sp = 0; + h.b.addBuff(u, { key: 'test:noSp', flags: { noSp: true } }); + h.run(1); // S3's arrows land + // priority: an enemy in her own range nearer the goal loses to the one of the area + const near = h.spawn('enemy_dummy', { pos: [10, 4] }); + const atkAt = []; + h.b.on('damaged', (c) => { if (c.source === u && c.dmg.isAttack) atkAt.push([c, u.s.atk]); }, { priority: -100 }); + h.run(3); + assert.ok(atkAt.length >= 1 && atkAt.every(([c]) => c.target === away), `${mod}: she shoots the area's enemy first`); + for (const [c, atk] of atkAt) approx(c.amount, atk * 1.2 * (mod === HY ? 1.33 / 1.2 : 1) * (1 + ds), `${mod}: ×${1 + ds} in the area`); + h.b.kill(away, null); + const n = atkAt.length; + h.run(3); + for (const [c, atk] of atkAt.slice(n)) { assert.equal(c.target, near); approx(c.amount, atk * (mod === HY ? 1.33 : 1.2), 'no bonus outside'); } + // it leaves after its 25 s, her range is her own again + const life = tokOf(tier, elite, mod).talents[0].bb.duration; + assert.equal(life, 25); + assert.ok(h.runUntil(() => !t.alive, 30), 'leaves'); + approx(h.b.time, life + h.b.dt, `${mod}: after ${life} s`, 0.02); + assert.ok(!u.rangeKeySet.has(11 * 21 + 7), 'her range back'); + // back after its redeploy time, paying 3 DP + h.b.players[0].dp = 10; + const left = h.b.time; + assert.ok(h.runUntil(() => t.alive, resp + 2), `${mod}: back`); + approx(h.b.time - left, resp, `${mod}: after ${resp} s`, 0.3); + assert.deepEqual([t.tileR, t.tileC, h.b.players[0].dp], [10, 6, 7], `${mod}: on its tile, 3 DP paid`); + done(h); + } + } +}); + +test('沙地兽 with S2: 广域警觉 cuts its redeploy time by 20 % / 30 % while on; its passive gives back the bullets that hit in its area when it leaves; withdrawn when 莱伊 leaves, back once she is', () => { + for (const [tier, elite, mod, resp] of [[5, false, null, 30], [6, true, null, 30], [6, true, HX, 20]]) { + const sk = skillOf(tier, elite, S2); + const { h, u, t } = field({ tier, elite, mod, skill: 1, beast: [10, 6] }); + const e = h.spawn('enemy_dummy', { pos: [11, 7] }); // in its area only + // the bullets that hit in its area: counted, given back when it leaves + h.runUntil(() => u.trait.ammo <= 3, 20); + const spent = 8 - u.trait.ammo; + h.b.addBuff(u, { key: 'test:disarm', flags: { disarm: true } }); + h.run(1); + const before = u.trait.ammo; + assert.ok(h.runUntil(() => !t.alive, 30), 'leaves'); + assert.equal(u.trait.ammo, Math.min(8, before + spent), `T${tier}: ${spent} bullets back`); + h.b.removeBuff(u, 'test:disarm'); + h.b.kill(e, null); + // S2 on ⇒ redeploy ×(1 + respawn_time) + u.skill.gainSp(999, 'init'); + h.step(); + assert.ok(u.skill.active, 'S2 on'); + const left = h.b.time; + assert.ok(h.runUntil(() => t.alive, resp + 2), 'back'); + approx(h.b.time - left, resp * (1 + sk.bb.respawn_time), `T${tier} ${mod}: ${resp} × ${1 + sk.bb.respawn_time} s`, 0.3); + // 莱伊 leaves: the 沙地兽 goes too; it waits for her + h.b.retreat(u); + h.step(); + assert.ok(!t.alive, 'withdrawn with her'); + h.run(resp + 5); + assert.ok(!t.alive, 'not back while she is away'); + h.b.redeploy(u); + assert.ok(h.runUntil(() => t.alive, 2), 'back with her'); + done(h); + } +}); diff --git a/test/golden/diy.json b/test/golden/diy.json index 0793c28c..9466049f 100644 --- a/test/golden/diy.json +++ b/test/golden/diy.json @@ -1974,8 +1974,8 @@ "snaps": "8eac4d32 fa5c2376 bc1e9184 84fb1db6 b4b3b807 cc6f6399 c665e4ff 261094cd 5d5c61fd 1bf27396 b526ffa6 e433a3a2 7d8bd521 d7eb687d 4d18ecc9 f640c5fd 0912a7d6 cc22df71 1a833e56 d877d28b 8a887ef8 8014c7dd" }, "diy-049": { - "about": "5_diy1_a=cdfend 5_diy2_b=cdfend 5_diy1_a=cguard 5_diy2_b=cguard 5_diy1_a=csnipe 5_diy2_b=csnipe 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": true, + "about": "5_diy1_a=chen2/S1 5_diy2_a=chen2/S2 5_diy1_a=chen2/S3 5_diy2_b=chen2/S1 5_diy1_b=chen2/S2 5_diy2_b=chen2/S3 5_diy1_b=chen2/S1/002_chen2 5_diy2_b=chen2/S2/002_chen2 5_diy1_b=chen2/S3/002_chen2 5_diy2_b=chen2/S1/003_chen2 5_diy1_b=chen2/S2/003_chen2 5_diy2_b=chen2/S3/003_chen2", + "fast": false, "kind": "normal", "stageId": "act1autochess_m05", "modeId": "mode_multi_normal", @@ -1985,122 +1985,115 @@ "time": 230, "ticks": 6900, "reason": "timeout", - "killed": 2, + "killed": 23, "total": 60, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 0, + "rngDraws": 299, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":2,"total":60,"perfect":false,"leaks":58,"leaksUncounted":0,"coins":0,"dmg":267738,"bossDmg":0,"heal":59968,"deaths":6,"layerGains":{}}}, + "players": {"p1":{"killed":23,"total":60,"perfect":false,"leaks":37,"leaksUncounted":0,"coins":0,"dmg":1146961,"bossDmg":0,"heal":0,"deaths":10,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,76,0,304,6384,0,22,1], - ["p1",2,"op","chess_char_5_diy2_b",2,"none",0,0,75,0,652,8724,0,41,2], - ["p1",3,"op","chess_char_5_diy1_a",2,null,2564,1,6,0,21282,21790,0,137,3], - ["p1",4,"op","chess_char_5_diy2_b",2,"none",3334,1,8,2,22607,38177,0,115,4], - ["p1",5,"op","chess_char_5_diy1_a",2,null,1271,1,10,0,2272,0,0,99,2], - ["p1",6,"op","chess_char_5_diy2_b",2,"none",1510,1,11,0,2916,0,0,108,3], - ["p1",7,"op","chess_char_5_diy1_a",2,null,1133,1,1,0,0,0,0,0,0], - ["p1",8,"op","chess_char_5_diy2_b",2,"none",1360,1,3,0,97722,0,0,178,4], - ["p1",9,"op","chess_char_5_diy1_a",2,null,1218,1,5,0,0,0,29529,69,4], - ["p1",10,"op","chess_char_5_diy2_b",2,"none",1374,1,7,0,0,0,30439,60,4], - ["p1",11,"op","chess_char_5_diy1_a",2,null,932,1,9,0,56880,0,0,144,3], - ["p1",12,"op","chess_char_5_diy2_b",2,"none",1131,1,12,0,63104,0,0,136,3] + ["p1",1,"op","chess_char_5_diy1_a",0,null,1875,1,10,0,22517,0,0,51,5], + ["p1",2,"op","chess_char_5_diy2_a",1,null,1875,1,11,0,37968,0,0,56,3], + ["p1",3,"op","chess_char_5_diy1_a",2,null,1875,1,1,8,77034,0,0,88,2], + ["p1",4,"op","chess_char_5_diy2_b",0,"none",2290,1,3,5,126301,0,0,97,10], + ["p1",5,"op","chess_char_5_diy1_b",1,"none",2290,1,5,3,143056,0,0,96,5], + ["p1",6,"op","chess_char_5_diy2_b",2,"none",2290,1,7,1,420504,0,0,87,2], + ["p1",7,"op","chess_char_5_diy1_b",0,"uniequip_002_chen2",2290,1,9,0,0,0,0,0,0], + ["p1",8,"op","chess_char_5_diy2_b",1,"uniequip_002_chen2",2290,1,12,0,115378,0,0,80,4], + ["p1",9,"op","chess_char_5_diy1_b",2,"uniequip_002_chen2",2290,1,79,4,35459,4580,0,26,1], + ["p1",10,"op","chess_char_5_diy2_b",0,"uniequip_003_chen2",1116.3,1,80,1,58145,6159,0,32,3], + ["p1",11,"op","chess_char_5_diy1_b",1,"uniequip_003_chen2",0,0,77,0,50242,7275,0,21,1], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_003_chen2",0,0,78,0,60357,7275,0,34,1] ], - "enemies": {"enemy_1045_hammer_2":[12,0,11,37471,77249],"enemy_1061_zomshd":[48,2,45,37605,269489]}, - "hooks": [1,76,6900,1205,1205,3051,3051,29902,8,64,33,29,0,37113,285,23,60,56,1,8,0,0,0], - "events": {"atk":1205,"deploy":16,"die":8,"dmg":3051,"heal":129,"leak":56,"skill":62,"spawn":72,"status":555}, - "fx": {}, - "snaps": "c6bdc18a 6fb12fe1 c3c94d6f f42e9bba 6ea4c93a ff3506ac f551dbb2 248e7a29 e877982d 0b8ac60e d21ffc26 89eda7b5 7ef13ac0 2d2fce6f 32484e38 3407d0b5 1b59f452 55141007 fc87be97 6239dcab e11e96f9 250fe5b6 a75b766c" + "enemies": {"enemy_1045_hammer_2":[12,0,12,12971,88407],"enemy_1061_zomshd":[48,23,24,12317,1128449]}, + "hooks": [1,80,6900,699,699,4321,4321,47243,33,69,37,35,397,26577,0,12,60,36,1,33,0,0,0], + "events": {"atk":2237,"deploy":20,"die":33,"dmg":4321,"fx":107,"leak":36,"skill":72,"spawn":72}, + "fx": {"reload":51,"zone":56}, + "snaps": "cd5ab93f 0fdb1e7c 557181fd 2610c393 ffe004fb 79253f5d aacadc7f fca301fb 9f41cc07 88f28c30 1eed72e2 4f156152 051e0c90 2d42fdf6 b5c18831 5882c826 bb8dea4d 7d347742 a689f424 cf326f7e fc946b30 8ca74e36 d030e9c5" }, "diy-050": { - "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=acnipe 5_diy2_b=acnipe 5_diy1_a=accast 5_diy2_b=accast 5_diy1_a=acmedc 5_diy2_b=acmedc", + "about": "6_diy1_a=chen2/S1 6_diy2_a=chen2/S2 6_diy1_a=chen2/S3 6_diy2_b=chen2/S1 6_diy1_b=chen2/S2 6_diy2_b=chen2/S3 6_diy1_b=chen2/S1/002_chen2 6_diy2_b=chen2/S2/002_chen2 6_diy1_b=chen2/S3/002_chen2 6_diy2_b=chen2/S1/003_chen2 6_diy1_b=chen2/S2/003_chen2 6_diy2_b=chen2/S3/003_chen2", "fast": false, "kind": "normal", "stageId": "act1autochess_m06", "modeId": "mode_multi_hard", - "round": 12, + "round": 13, "seed": 574294847, - "waveId": "act1autochess_h05", - "time": 214.8, - "ticks": 6444, + "waveId": "act1autochess_h06", + "time": 213.6, + "ticks": 6408, "reason": "cleared", - "killed": 0, - "total": 60, + "killed": 9, + "total": 105, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 115, + "rngDraws": 20, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":0,"total":60,"perfect":false,"leaks":60,"leaksUncounted":0,"coins":0,"dmg":157435,"bossDmg":0,"heal":12039,"deaths":23,"layerGains":{}}}, + "players": {"p1":{"killed":9,"total":105,"perfect":false,"leaks":96,"leaksUncounted":0,"coins":0,"dmg":176875,"bossDmg":0,"heal":0,"deaths":20,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,82,0,28,5208,0,2,0], - ["p1",2,"op","chess_char_5_diy2_b",2,"uniequip_002_acfend",3371,1,6,0,0,0,0,0,0], - ["p1",3,"op","chess_char_5_diy1_a",2,null,1529,1,9,0,20856,0,0,0,7], - ["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acpion",0,0,72,0,174,5712,0,6,0], - ["p1",5,"op","chess_char_5_diy1_a",2,null,0,0,67,0,13430,5276,0,29,1], - ["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acguad",0,0,78,0,61051,12366,0,48,2], - ["p1",7,"op","chess_char_5_diy1_a",2,null,0,0,85,0,698,3816,0,13,1], - ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_acnipe",0,0,84,0,2755,4761,0,39,1], - ["p1",9,"op","chess_char_5_diy1_a",2,null,0,0,52,0,19051,2744,0,7,1], - ["p1",10,"op","chess_char_5_diy2_b",2,"uniequip_002_accast",0,0,51,0,39393,3498,0,7,1], - ["p1",11,"op","chess_char_5_diy1_a",2,null,0,0,47,0,0,2448,1260,3,0], - ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acmedc",0,0,54,0,0,9324,10779,8,1] + ["p1",1,"op","chess_char_6_diy1_a",0,null,0,0,1,1,4895,1875,0,7,1], + ["p1",2,"op","chess_char_6_diy2_a",1,null,0,0,3,0,12046,1875,0,7,1], + ["p1",3,"op","chess_char_6_diy1_a",2,null,0,0,5,0,7430,1875,0,7,0], + ["p1",4,"op","chess_char_6_diy2_b",0,"none",0,0,2,1,11540,2290,0,7,1], + ["p1",5,"op","chess_char_6_diy1_b",1,"none",0,0,8,2,14249,2290,0,5,1], + ["p1",6,"op","chess_char_6_diy2_b",2,"none",0,0,67,0,11342,4580,0,6,0], + ["p1",7,"op","chess_char_6_diy1_b",0,"uniequip_002_chen2",0,0,65,0,5635,4580,0,6,0], + ["p1",8,"op","chess_char_6_diy2_b",1,"uniequip_002_chen2",0,0,7,2,22739,2290,0,8,1], + ["p1",9,"op","chess_char_6_diy1_b",2,"uniequip_002_chen2",0,0,9,0,10530,2290,0,6,0], + ["p1",10,"op","chess_char_6_diy2_b",0,"uniequip_003_chen2",0,0,111,0,14362,7410,0,11,0], + ["p1",11,"op","chess_char_6_diy1_b",1,"uniequip_003_chen2",0,0,118,2,28476,7410,0,11,1], + ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_003_chen2",0,0,125,1,33633,7410,0,12,0] ], - "enemies": {"enemy_1045_hammer_2":[12,0,12,15694,22503],"enemy_1061_zomshd":[48,0,48,39458,134932]}, - "hooks": [1,85,6444,245,245,412,396,10112,23,83,15,15,0,16629,0,28,60,60,1,26,0,0,16], - "events": {"atk":263,"deploy":25,"die":23,"dmg":396,"fx":86,"heal":23,"leak":60,"skill":30,"spawn":72,"status":14}, - "fx": {"aoe":5,"dodge":16,"dp":7,"slash":56,"spGain":2}, - "snaps": "580b238a aa91295b 3af047b3 a833e612 f6a0b595 1eba1563 0c047aab 7838a66c 34fc5adc 627a4814 4d7c5d84 41a4b79a 721f8563 f6d5a347 76cda6c2 74e73fdb 220b1dd6 2f7b90e4 d3a2ce26 6a84c6a3 1aae6574 0e8ef572" + "enemies": {"enemy_1165_duhond":[51,9,42,4962,106064],"enemy_1174_duholy_2":[24,0,24,16928,28959],"enemy_1175_dushdo_2":[30,0,30,24285,41852]}, + "hooks": [1,125,6408,148,148,298,298,0,29,125,6,6,20,5349,0,27,105,96,1,29,0,0,0], + "events": {"atk":302,"deploy":20,"die":29,"dmg":298,"fx":13,"leak":96,"skill":12,"spawn":117,"status":95}, + "fx": {"reload":4,"zone":9}, + "snaps": "bd64d67f f3df83b6 2b856b69 b6ac8170 0e517a9b f3c238f3 e39423d6 d8b530e9 7deb9725 9e8e1489 6b298bbe ca59d939 083a021d 65b35107 8994b3f8 ca994722 c744f8dc e6e50b34 b7c27ed6 31666d8b 37e1fde4 b8746a75" }, "diy-051": { - "about": "6_diy1_a=acfend 6_diy2_b=acfend 5_diy1_a=sharp2 5_diy2_b=sharp2 6_diy1_a=acpion 6_diy2_b=acpion 5_diy1_a=acspec 5_diy2_b=acspec 6_diy1_a=acguad 6_diy2_b=acguad 5_diy1_a=acsupo 5_diy2_b=acsupo", + "about": "5_diy1_a=ray/S1 5_diy2_a=ray/S2 5_diy1_a=ray/S3 5_diy2_b=ray/S1 5_diy1_b=ray/S2 5_diy2_b=ray/S3 5_diy1_b=ray/S1/002_ray 5_diy2_b=ray/S2/002_ray 5_diy1_b=ray/S3/002_ray 5_diy2_b=ray/S1/003_ray 5_diy1_b=ray/S2/003_ray 5_diy2_b=ray/S3/003_ray", "fast": false, "kind": "normal", "stageId": "act1autochess_m07", "modeId": "mode_single_normal", - "round": 13, + "round": 12, "seed": 3864737019, - "waveId": "act1autochess_h06", - "time": 204.8, - "ticks": 6144, + "waveId": "act1autochess_h05", + "time": 184.7, + "ticks": 5541, "reason": "cleared", - "killed": 197, - "total": 290, + "killed": 69, + "total": 99, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 282, + "rngDraws": 0, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":197,"total":290,"perfect":false,"leaks":93,"leaksUncounted":0,"coins":0,"dmg":444885,"bossDmg":0,"heal":0,"deaths":15,"layerGains":{}}}, + "players": {"p1":{"killed":69,"total":99,"perfect":false,"leaks":30,"leaksUncounted":0,"coins":0,"dmg":1013986,"bossDmg":0,"heal":0,"deaths":0,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_6_diy1_a",2,null,0,0,4,7,21881,2604,0,65,1], - ["p1",2,"op","chess_char_6_diy2_b",2,"uniequip_002_acfend",0,0,7,11,35637,3431,0,87,2], - ["p1",3,"op","chess_char_5_diy1_a",0,null,1560.61,1,279,11,28493,2169,0,91,2], - ["p1",4,"op","chess_char_5_diy2_b",0,"uniequip_002_sharp2",1890.36,1,277,51,98505,2858,0,110,3], - ["p1",5,"op","chess_char_6_diy1_a",2,null,0,0,241,13,39114,3058,0,54,3], - ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acpion",0,0,163,43,73993,3808,0,55,4], - ["p1",7,"op","chess_char_5_diy1_a",2,null,0,0,285,5,26351,8078,0,87,0], - ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_acspec",1448,1,3,7,19,0,0,16,0], - ["p1",9,"op","chess_char_6_diy1_a",2,null,2638,1,5,10,60,0,0,60,3], - ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_acguad",2339.65,1,8,13,64107,1191,0,82,3], - ["p1",11,"op","chess_char_5_diy1_a",2,null,1160,1,6,10,18397,0,0,78,2], - ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acsupo",1430,1,9,16,38328,0,0,93,2], + ["p1",1,"op","chess_char_5_diy1_a",0,null,1507,1,5,2,15777,0,0,12,5], + ["p1",2,"op","chess_char_5_diy2_a",1,null,1507,1,7,2,8643,0,0,15,0], + ["p1",3,"op","chess_char_5_diy1_a",2,null,1507,1,9,5,77791,0,0,44,3], + ["p1",4,"op","chess_char_5_diy2_b",0,"none",1789,1,11,5,85214,0,0,49,12], + ["p1",5,"op","chess_char_5_diy1_b",1,"none",1789,1,13,2,107832,0,0,57,1], + ["p1",6,"op","chess_char_5_diy2_b",2,"none",1789,1,6,15,137192,0,0,68,5], + ["p1",7,"op","chess_char_5_diy1_b",0,"uniequip_002_ray",1939,1,8,3,18448,0,0,11,5], + ["p1",8,"op","chess_char_5_diy2_b",1,"uniequip_002_ray",1939,1,10,9,133010,0,0,71,1], + ["p1",9,"op","chess_char_5_diy1_b",2,"uniequip_002_ray",1939,1,12,16,165563,0,0,83,5], + ["p1",10,"op","chess_char_5_diy2_b",0,"uniequip_003_ray",1889,1,14,4,167731,0,0,80,16], + ["p1",11,"op","chess_char_5_diy1_b",1,"uniequip_003_ray",1889,1,3,0,34326,0,0,24,1], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_003_ray",1889,1,4,6,62459,0,0,39,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] ], - "enemies": { - "enemy_1195_sfyin": [39,30,9,4143,113683], - "enemy_1196_msfyin": [60,32,28,0,65], - "enemy_1197_sfshu": [48,38,10,10130,184299], - "enemy_1198_msfshu": [114,78,36,0,243], - "enemy_1199_sfjin": [18,11,7,12925,146349], - "enemy_1200_msfjin": [11,8,3,0,246] - }, - "hooks": [1,314,6144,1470,1470,1969,2082,0,212,305,25,30,0,33234,6218,91,290,93,1,212,0,0,11], - "events": {"atk":1512,"deploy":22,"die":212,"dmg":2076,"fx":273,"leak":93,"skill":48,"spawn":304,"status":488}, - "fx": {"aoe":56,"displace":1,"dodge":22,"dp":63,"slash":52,"summon":79}, - "snaps": "cf051c06 587dcba3 94ed6adb bba4fd81 815661ad cbf17744 a8d0c19b 32b88916 1e8bde83 51a1d669 b023b185 df725cf4 bf4681aa 2c372e04 1a001766 3d81d3d6 7f8effe5 11826d80 b4fb05d0 0eed6d6c 65f6503d" + "enemies": {"enemy_1010_demon":[42,33,9,0,434884],"enemy_1320_wdrrl_2":[12,3,9,0,228094],"enemy_1422_lrsldr_2":[45,33,12,0,351008]}, + "hooks": [1,113,5541,553,553,540,540,0,69,99,57,52,0,27079,91,0,99,30,1,69,0,0,0], + "events": {"atk":553,"deploy":12,"die":69,"dmg":540,"fx":17,"leak":30,"skill":109,"spawn":113,"status":114}, + "fx": {"displace":17}, + "snaps": "788791d7 0385a31e b6f0ae7a 3eb8dcc6 bb09f375 c68b22d7 a0256d7c ceaafb1f 1f4cd067 90c9a236 1e341763 dac234e5 49e5e504 e4805d19 014b30d9 c2945872 b3dba769 e883176c 3dcf0f08" }, "diy-052": { - "about": "6_diy1_a=sharp2 6_diy2_b=sharp2 6_diy1_a=acspec 6_diy2_b=acspec 6_diy1_a=acnipe 6_diy2_b=acnipe 6_diy1_a=accast 6_diy2_b=accast 6_diy1_a=acmedc 6_diy2_b=acmedc 6_diy1_a=acsupo 6_diy2_b=acsupo", + "about": "6_diy1_a=ray/S1 6_diy2_a=ray/S2 6_diy1_a=ray/S3 6_diy2_b=ray/S1 6_diy1_b=ray/S2 6_diy2_b=ray/S3 6_diy1_b=ray/S1/002_ray 6_diy2_b=ray/S2/002_ray 6_diy1_b=ray/S3/002_ray 6_diy2_b=ray/S1/003_ray 6_diy1_b=ray/S2/003_ray 6_diy2_b=ray/S3/003_ray", "fast": false, "kind": "normal", "stageId": "act2autochess_m01", @@ -2108,35 +2101,282 @@ "round": 13, "seed": 1210502478, "waveId": "act1autochess_h06", - "time": 218.57, - "ticks": 6557, + "time": 218.07, + "ticks": 6542, "reason": "cleared", - "killed": 0, + "killed": 1, "total": 123, "unspawned": 0, "bossHpLeft": null, - "rngDraws": 81, + "rngDraws": 0, "errors": {"count":0,"kinds":[]}, - "players": {"p1":{"killed":0,"total":123,"perfect":false,"leaks":123,"leaksUncounted":0,"coins":0,"dmg":76446,"bossDmg":0,"heal":2762,"deaths":33,"layerGains":{}}}, + "players": {"p1":{"killed":1,"total":123,"perfect":false,"leaks":122,"leaksUncounted":0,"coins":0,"dmg":202003,"bossDmg":0,"heal":0,"deaths":22,"layerGains":{}}}, "units": [ - ["p1",1,"op","chess_char_6_diy1_a",0,null,0,0,6,0,2101,1865,0,8,0], - ["p1",2,"op","chess_char_6_diy2_b",0,"uniequip_002_sharp2",0,0,9,0,4660,2494,0,8,0], - ["p1",3,"op","chess_char_6_diy1_a",2,null,1154,1,157,0,13058,11540,0,21,0], - ["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acspec",0,0,156,0,24836,14840,0,17,0], - ["p1",5,"op","chess_char_6_diy1_a",2,null,0,0,151,0,3559,2544,0,18,0], - ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acnipe",0,0,3,0,11692,1643,0,23,0], - ["p1",7,"op","chess_char_6_diy1_a",2,null,0,0,4,0,9700,1372,0,5,1], - ["p1",8,"op","chess_char_6_diy2_b",2,"uniequip_002_accast",0,0,11,0,1022,1819,0,1,0], - ["p1",9,"op","chess_char_6_diy1_a",2,null,0,0,86,0,0,4120,2092,4,1], - ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_acmedc",0,0,74,0,0,4018,670,2,0], - ["p1",11,"op","chess_char_6_diy1_a",2,null,0,0,1,0,1487,1160,0,3,1], - ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_002_acsupo",0,0,5,0,4330,1450,0,7,1] + ["p1",1,"op","chess_char_6_diy1_a",0,null,0,0,145,0,26479,4521,0,18,3], + ["p1",2,"op","chess_char_6_diy2_a",1,null,0,0,118,0,7877,3014,0,8,0], + ["p1",3,"op","chess_char_6_diy1_a",2,null,0,0,128,0,22696,3014,0,12,1], + ["p1",4,"op","chess_char_6_diy2_b",0,"none",0,0,138,0,30245,5367,0,15,3], + ["p1",5,"op","chess_char_6_diy1_b",1,"none",0,0,79,0,9492,3578,0,8,0], + ["p1",6,"op","chess_char_6_diy2_b",2,"none",0,0,75,0,5865,3578,0,5,0], + ["p1",7,"op","chess_char_6_diy1_b",0,"uniequip_002_ray",0,0,7,0,11416,1989,0,6,2], + ["p1",8,"op","chess_char_6_diy2_b",1,"uniequip_002_ray",0,0,73,0,3619,3978,0,3,0], + ["p1",9,"op","chess_char_6_diy1_b",2,"uniequip_002_ray",0,0,8,0,21060,1989,0,7,1], + ["p1",10,"op","chess_char_6_diy2_b",0,"uniequip_003_ray",0,0,69,0,7541,3978,0,3,1], + ["p1",11,"op","chess_char_6_diy1_b",1,"uniequip_003_ray",0,0,1,0,16318,1989,0,11,0], + ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_003_ray",0,0,5,1,39395,1989,0,12,1] ], - "enemies": {"enemy_1019_jshoot_2":[57,0,57,29550,4113],"enemy_1299_ymkilr_2":[27,0,27,14576,26756],"enemy_1422_lrsldr_2":[39,0,39,4739,45577]}, - "hooks": [1,157,6557,277,277,283,291,7,33,156,4,24,0,6272,192,29,123,123,1,33,0,0,0], - "events": {"atk":278,"deploy":34,"die":33,"dmg":269,"fx":19,"heal":7,"leak":123,"skill":8,"spawn":135,"status":92}, - "fx": {"aoe":2,"displace":15,"spGain":2}, - "snaps": "21be44ba 23e43266 29788d55 2f1037e9 363ad836 051606c5 26acdfeb 8dc54607 7a7c6a86 7ebe59b3 d1661fdb 203d434c 2e82423b f7e9ffc1 7a1afa0e 8998df31 0ca38cb6 f3ac5677 87bcc7cf 0f5f3879 0e082cac 62241cef" + "enemies": {"enemy_1019_jshoot_2":[57,0,57,24462,1184],"enemy_1299_ymkilr_2":[27,0,27,12642,80197],"enemy_1422_lrsldr_2":[39,1,38,1880,120622]}, + "hooks": [1,145,6542,210,210,190,190,0,23,145,12,12,0,4614,20,17,123,122,1,23,0,0,0], + "events": {"atk":210,"deploy":22,"die":23,"dmg":190,"fx":7,"leak":122,"skill":24,"spawn":135,"status":26}, + "fx": {"displace":7}, + "snaps": "7c4f90ab 0ea5d002 a612ad7a c1c3d391 e988c197 1fede535 d3e13f11 97bc0d22 e8a17b47 fae6dfe3 07c03f79 560c6dee cfaebf07 cb423c2d fb1ebe81 a84f58c8 849372f4 eeeafbf9 56b58f09 bbe0a6a3 8205d5f2 932ffef9" + }, + "diy-053": { + "about": "5_diy1_a=ascln/S1 5_diy2_a=ascln/S2 5_diy1_a=ascln/S3 5_diy2_b=ascln/S1 5_diy1_b=ascln/S2 5_diy2_b=ascln/S3 5_diy1_b=ascln/S1/002_ascln 5_diy2_b=ascln/S2/002_ascln 5_diy1_b=ascln/S3/002_ascln 5_diy2_b=ascln/S1/003_ascln 5_diy1_b=ascln/S2/003_ascln 5_diy2_b=ascln/S3/003_ascln", + "fast": false, + "kind": "normal", + "stageId": "act2autochess_m02", + "modeId": "mode_multi_funny", + "round": 12, + "seed": 2850577873, + "waveId": "act1autochess_h05", + "time": 230, + "ticks": 6900, + "reason": "timeout", + "killed": 92, + "total": 114, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 211, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":92,"total":114,"perfect":false,"leaks":22,"leaksUncounted":0,"coins":0,"dmg":734191,"bossDmg":0,"heal":1511,"deaths":18,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_a",0,null,0,0,136,3,4096,2466,0,6,2], + ["p1",2,"op","chess_char_5_diy2_a",1,null,0,0,135,3,11798,2466,0,9,1], + ["p1",3,"op","chess_char_5_diy1_a",2,null,0,0,124,3,10675,2614,148,14,2], + ["p1",4,"op","chess_char_5_diy2_b",0,"none",0,0,134,10,84832,2984,0,21,9], + ["p1",5,"op","chess_char_5_diy1_b",1,"none",0,0,112,9,101096,2984,0,32,2], + ["p1",6,"op","chess_char_5_diy2_b",2,"none",0,0,91,13,106334,3770,786,40,2], + ["p1",7,"op","chess_char_5_diy1_b",0,"uniequip_002_ascln",0,0,102,14,147245,3344,0,34,12], + ["p1",8,"op","chess_char_5_diy2_b",1,"uniequip_002_ascln",1672,1,8,6,60392,0,0,26,3], + ["p1",9,"op","chess_char_5_diy1_b",2,"uniequip_002_ascln",1672,1,137,6,70653,2174,502,52,2], + ["p1",10,"op","chess_char_5_diy2_b",0,"uniequip_003_ascln",0,0,9,8,20920,1492,0,12,12], + ["p1",11,"op","chess_char_5_diy1_b",1,"uniequip_003_ascln",0,0,130,8,55409,2984,0,12,1], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_003_ascln",889,1,6,9,60740,678,75,27,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_1166_dusbr_2":[45,45,0,0,190080],"enemy_1169_duphlx_2":[51,46,5,0,278707],"enemy_1172_dugago":[18,1,16,27956,265404]}, + "hooks": [1,137,6900,496,496,4055,3934,31,110,131,50,50,0,25191,0,0,114,21,1,128,0,0,121], + "events": {"atk":1143,"deploy":21,"die":110,"dmg":3934,"fx":207,"heal":21,"leak":21,"skill":100,"spawn":128,"status":150}, + "fx": {"aoe":50,"dodge":121,"revive":18,"stone":18}, + "snaps": "5110691f 72914522 ed9b8f0e 4b9c7331 c9dc13f6 e41f71f3 5a5394cb 4901c1d5 afb5f33e 722b1388 a2543798 4b3c4a59 962c0e86 1595b8cb 132c8dc5 04e936d8 4f8caa58 e6ffc6f9 93398e10 fc0d39a4 cf96bff4 53c1a4b9 5e4b3a9e" + }, + "diy-054": { + "about": "6_diy1_a=ascln/S1 6_diy2_a=ascln/S2 6_diy1_a=ascln/S3 6_diy2_b=ascln/S1 6_diy1_b=ascln/S2 6_diy2_b=ascln/S3 6_diy1_b=ascln/S1/002_ascln 6_diy2_b=ascln/S2/002_ascln 6_diy1_b=ascln/S3/002_ascln 6_diy2_b=ascln/S1/003_ascln 6_diy1_b=ascln/S2/003_ascln 6_diy2_b=ascln/S3/003_ascln", + "fast": false, + "kind": "normal", + "stageId": "act2autochess_m03", + "modeId": "mode_single_hard", + "round": 13, + "seed": 196461732, + "waveId": "act1autochess_h06", + "time": 229.47, + "ticks": 6884, + "reason": "cleared", + "killed": 0, + "total": 66, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 210, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":0,"total":66,"perfect":false,"leaks":66,"leaksUncounted":0,"coins":0,"dmg":0,"bossDmg":0,"heal":0,"deaths":18,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_6_diy1_a",0,null,1233,1,92,0,0,2466,0,0,0], + ["p1",2,"op","chess_char_6_diy2_a",1,null,0,0,85,0,0,2466,0,0,0], + ["p1",3,"op","chess_char_6_diy1_a",2,null,1233,1,10,0,0,0,0,0,0], + ["p1",4,"op","chess_char_6_diy2_b",0,"none",1414.7,1,89,0,0,3061,0,0,0], + ["p1",5,"op","chess_char_6_diy1_b",1,"none",1492,1,91,0,0,2984,0,0,0], + ["p1",6,"op","chess_char_6_diy2_b",2,"none",0,0,63,0,0,2984,0,0,0], + ["p1",7,"op","chess_char_6_diy1_b",0,"uniequip_002_ascln",0,0,61,0,0,3524,0,0,0], + ["p1",8,"op","chess_char_6_diy2_b",1,"uniequip_002_ascln",0,0,54,0,0,3524,0,0,0], + ["p1",9,"op","chess_char_6_diy1_b",2,"uniequip_002_ascln",0,0,5,0,0,1762,0,0,0], + ["p1",10,"op","chess_char_6_diy2_b",0,"uniequip_003_ascln",0,0,7,0,0,1492,0,0,0], + ["p1",11,"op","chess_char_6_diy1_b",1,"uniequip_003_ascln",1492,1,9,0,0,0,0,0,0], + ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_003_ascln",0,0,60,0,0,2984,0,0,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_1005_yokai_2":[12,0,12,380,0],"enemy_1041_lazerd_2":[24,0,24,26867,0],"enemy_1042_frostd":[30,0,30,0,0]}, + "hooks": [1,92,6884,218,218,210,94,0,18,84,0,0,0,10164,0,0,66,66,1,18,0,0,116], + "events": {"atk":218,"deploy":23,"die":18,"dmg":94,"fx":116,"leak":66,"spawn":81,"status":55}, + "fx": {"dodge":116}, + "snaps": "910c97bb 130fc0e1 905f0e93 73da5f31 71621b44 aba58c52 8966775d acb90de7 8b8b2d75 a02eba4f 5ebe7409 1d1332b0 85be09b1 c3497722 5aee2190 633141dc e5de2bc3 33570b77 1770b3f9 97fe806f c8039883 d03dd722 0b7243af" + }, + "diy-055": { + "about": "5_diy1_a=cdfend 5_diy2_b=cdfend 5_diy1_a=cguard 5_diy2_b=cguard 5_diy1_a=csnipe 5_diy2_b=csnipe 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": true, + "kind": "normal", + "stageId": "act2autochess_m04", + "modeId": "mode_multi_normal", + "round": 12, + "seed": 1597707536, + "waveId": "act1autochess_h05", + "time": 226.43, + "ticks": 6793, + "reason": "cleared", + "killed": 8, + "total": 117, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 0, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":8,"total":117,"perfect":false,"leaks":109,"leaksUncounted":0,"coins":0,"dmg":52598,"bossDmg":0,"heal":8900,"deaths":25,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,117,0,0,6078,0,0,0], + ["p1",2,"op","chess_char_5_diy2_b",2,"none",0,0,111,0,0,7823,0,0,0], + ["p1",3,"op","chess_char_5_diy1_a",2,null,0,0,144,0,0,5128,0,0,0], + ["p1",4,"op","chess_char_5_diy2_b",2,"none",208.49,1,145,0,0,10902,0,0,0], + ["p1",5,"op","chess_char_5_diy1_a",2,null,0,0,132,0,18064,2542,0,48,1], + ["p1",6,"op","chess_char_5_diy2_b",2,"none",868.62,1,146,5,21138,3661,0,44,1], + ["p1",7,"op","chess_char_5_diy1_a",2,null,0,0,86,1,660,2480,0,2,0], + ["p1",8,"op","chess_char_5_diy2_b",2,"none",0,0,79,1,4810,2924,0,9,0], + ["p1",9,"op","chess_char_5_diy1_a",2,null,0,0,5,0,0,1218,5678,12,1], + ["p1",10,"op","chess_char_5_diy2_b",2,"none",0,0,92,0,0,4841,3223,7,1], + ["p1",11,"op","chess_char_5_diy1_a",2,null,0,0,142,0,3950,2796,0,11,0], + ["p1",12,"op","chess_char_5_diy2_b",2,"none",0,0,135,1,3976,4845,0,9,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] + ], + "enemies": {"enemy_1005_yokai":[51,8,43,0,18454],"enemy_1005_yokai_2":[54,0,54,21039,2515],"enemy_1005_yokai_3":[12,0,12,34200,31629]}, + "hooks": [1,146,6793,492,492,425,425,19,33,142,4,4,0,11479,18,0,117,109,1,33,0,0,0], + "events": {"atk":492,"deploy":27,"die":33,"dmg":425,"heal":19,"leak":109,"skill":8,"spawn":131,"status":28}, + "fx": {}, + "snaps": "e90d8ac5 3e7826d8 2ea79392 0d0a30f6 55810e9b a62c5a87 b1c5cfca 6959234f 84a973da 3386636e fa19929f 31ac9ec4 cc1b23bc 0ce6593e 1aa312f9 8de415cc 7670e151 f5f13c6f 12c4e5a4 75fb7a93 385d158a f1ce79bb 455d3b6d" + }, + "diy-056": { + "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=acnipe 5_diy2_b=acnipe 5_diy1_a=accast 5_diy2_b=accast 5_diy1_a=acmedc 5_diy2_b=acmedc", + "fast": false, + "kind": "normal", + "stageId": "act1autochess_m01", + "modeId": "mode_multi_hard", + "round": 12, + "seed": 3238296381, + "waveId": "act1autochess_h05", + "time": 208.03, + "ticks": 6241, + "reason": "cleared", + "killed": 3, + "total": 75, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 196, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":3,"total":75,"perfect":false,"leaks":72,"leaksUncounted":0,"coins":0,"dmg":162615,"bossDmg":0,"heal":9891,"deaths":23,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_5_diy1_a",2,null,0,0,7,0,249,2808,0,3,0], + ["p1",2,"op","chess_char_5_diy2_b",2,"uniequip_002_acfend",0,0,9,1,600,3371,0,5,0], + ["p1",3,"op","chess_char_5_diy1_a",2,null,0,0,97,1,12118,4587,0,5,1], + ["p1",4,"op","chess_char_5_diy2_b",2,"uniequip_002_acpion",0,0,101,0,24851,5712,0,11,1], + ["p1",5,"op","chess_char_5_diy1_a",2,null,0,0,68,0,6186,5276,0,8,0], + ["p1",6,"op","chess_char_5_diy2_b",2,"uniequip_002_acguad",0,0,8,0,35092,8965,0,13,1], + ["p1",7,"op","chess_char_5_diy1_a",2,null,0,0,75,0,17393,2748,0,33,1], + ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_acnipe",0,0,84,1,48820,3924,0,40,1], + ["p1",9,"op","chess_char_5_diy1_a",2,null,0,0,61,0,8325,3344,0,4,0], + ["p1",10,"op","chess_char_5_diy2_b",2,"uniequip_002_accast",0,0,55,0,8980,3498,0,4,0], + ["p1",11,"op","chess_char_5_diy1_a",2,null,0,0,93,0,0,3198,8062,15,1], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acmedc",1414,1,102,0,0,4657,1829,3,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_1267_nhpbr_2":[36,2,34,5542,68908],"enemy_1270_nhstlk_2":[27,1,26,12814,85923],"enemy_1272_nhtank_2":[12,0,12,33732,7784]}, + "hooks": [1,102,6241,222,222,529,526,32,26,98,6,6,0,8985,0,21,75,72,1,56,0,0,3], + "events": {"atk":261,"deploy":24,"die":26,"dmg":526,"fx":42,"heal":32,"leak":72,"skill":12,"spawn":90,"status":32}, + "fx": {"dodge":3,"dp":3,"slash":16,"spGain":2,"zone":18}, + "snaps": "4a66aa50 cd957f8d 29040588 85dbfdfb 24a06993 403a5cd0 af8c7db4 ece6f6e6 e208e92d b00a9483 cdbb6067 b86efe8c 4d65b9e6 9e9b8ccc 4dd884e0 de6f0bb5 1ee54cb6 187ba789 edc6ec98 27566532 7101f464" + }, + "diy-057": { + "about": "6_diy1_a=acfend 6_diy2_b=acfend 5_diy1_a=sharp2 5_diy2_b=sharp2 6_diy1_a=acpion 6_diy2_b=acpion 5_diy1_a=acspec 5_diy2_b=acspec 6_diy1_a=acguad 6_diy2_b=acguad 5_diy1_a=acsupo 5_diy2_b=acsupo", + "fast": false, + "kind": "normal", + "stageId": "act1autochess_m02", + "modeId": "mode_single_normal", + "round": 13, + "seed": 583790378, + "waveId": "act1autochess_h06", + "time": 229.57, + "ticks": 6887, + "reason": "cleared", + "killed": 25, + "total": 147, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 349, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":25,"total":147,"perfect":false,"leaks":122,"leaksUncounted":0,"coins":0,"dmg":447188,"bossDmg":0,"heal":0,"deaths":23,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_6_diy1_a",2,null,0,0,144,0,5014,5208,0,37,1], + ["p1",2,"op","chess_char_6_diy2_b",2,"uniequip_002_acfend",0,0,1,0,7239,3431,0,80,2], + ["p1",3,"op","chess_char_5_diy1_a",0,null,0,0,143,0,12621,3730,0,59,1], + ["p1",4,"op","chess_char_5_diy2_b",0,"uniequip_002_sharp2",0,0,139,5,129318,4748,0,83,2], + ["p1",5,"op","chess_char_6_diy1_a",2,null,1529,1,176,2,19391,3058,0,28,2], + ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acpion",1904,1,174,8,121508,3808,0,33,4], + ["p1",7,"op","chess_char_5_diy1_a",2,null,1154,1,165,0,5198,6924,0,54,0], + ["p1",8,"op","chess_char_5_diy2_b",2,"uniequip_002_acspec",1448,1,171,0,7386,4344,0,52,0], + ["p1",9,"op","chess_char_6_diy1_a",2,null,2638,1,177,2,17400,2638,0,21,1], + ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_acguad",0,0,146,6,70277,7062,0,82,2], + ["p1",11,"op","chess_char_5_diy1_a",2,null,1160,1,6,0,21302,0,0,139,3], + ["p1",12,"op","chess_char_5_diy2_b",2,"uniequip_002_acsupo",1430,1,8,2,30532,0,0,150,3] + ], + "enemies": {"enemy_1166_dusbr_2":[39,10,29,2081,102398],"enemy_1169_duphlx_2":[57,9,48,10670,156040],"enemy_1170_dushld_2":[51,6,45,32200,188750]}, + "hooks": [1,177,6887,1087,1087,1627,1734,0,48,170,21,28,0,26130,14208,52,147,122,1,48,0,0,14], + "events": {"atk":1145,"deploy":30,"die":48,"dmg":1705,"fx":155,"leak":122,"skill":40,"spawn":159,"status":1199}, + "fx": {"aoe":51,"displace":8,"dodge":32,"dp":16,"slash":48}, + "snaps": "3c92533d c853aee7 5b1063fd 5fc57b7e 4a05e8e6 38a71bec 3070ca8c d432fa88 49683316 30a3854a 9104d2b4 923ae15a 22aa5459 cdd051aa 9f802034 82bafa84 ccf4b89d e3e17beb 6eb62b58 fe7abec6 989ccd10 d648552b 98e9bf71" + }, + "diy-058": { + "about": "6_diy1_a=sharp2 6_diy2_b=sharp2 6_diy1_a=acspec 6_diy2_b=acspec 6_diy1_a=acnipe 6_diy2_b=acnipe 6_diy1_a=accast 6_diy2_b=accast 6_diy1_a=acmedc 6_diy2_b=acmedc 6_diy1_a=acsupo 6_diy2_b=acsupo", + "fast": false, + "kind": "normal", + "stageId": "act1autochess_m03", + "modeId": "mode_multi_abyss", + "round": 13, + "seed": 2224511831, + "waveId": "act1autochess_h06", + "time": 208.07, + "ticks": 6242, + "reason": "cleared", + "killed": 2, + "total": 105, + "unspawned": 0, + "bossHpLeft": null, + "rngDraws": 148, + "errors": {"count":0,"kinds":[]}, + "players": {"p1":{"killed":2,"total":105,"perfect":false,"leaks":103,"leaksUncounted":0,"coins":0,"dmg":240102,"bossDmg":0,"heal":14281,"deaths":30,"layerGains":{}}}, + "units": [ + ["p1",1,"op","chess_char_6_diy1_a",0,null,0,0,5,0,14676,1865,0,12,1], + ["p1",2,"op","chess_char_6_diy2_b",0,"uniequip_002_sharp2",0,0,7,1,65680,3799,0,21,1], + ["p1",3,"op","chess_char_6_diy1_a",2,null,1154,1,140,0,19129,12041,0,30,0], + ["p1",4,"op","chess_char_6_diy2_b",2,"uniequip_002_acspec",0,0,139,0,38020,15591,0,35,0], + ["p1",5,"op","chess_char_6_diy1_a",2,null,1272,1,131,0,5981,1272,0,26,0], + ["p1",6,"op","chess_char_6_diy2_b",2,"uniequip_002_acnipe",0,0,12,0,8584,1643,0,26,0], + ["p1",7,"op","chess_char_6_diy1_a",2,null,0,0,78,0,5748,4303,0,7,0], + ["p1",8,"op","chess_char_6_diy2_b",2,"uniequip_002_accast",0,0,4,1,75199,1819,0,10,1], + ["p1",9,"op","chess_char_6_diy1_a",2,null,0,0,6,0,0,2056,5589,7,1], + ["p1",10,"op","chess_char_6_diy2_b",2,"uniequip_002_acmedc",0,0,9,0,0,5567,8692,11,1], + ["p1",11,"op","chess_char_6_diy1_a",2,null,0,0,13,0,3038,1160,0,13,0], + ["p1",12,"op","chess_char_6_diy2_b",2,"uniequip_002_acsupo",0,0,73,0,4048,5494,0,11,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], + ["-","~3","device","trap_1105_accrate",null,null,100,1,3,0,0,0,0,0,null] + ], + "enemies": {"enemy_1229_darmy":[27,1,26,5045,88057],"enemy_1229_darmy_2":[57,1,56,19387,116235],"enemy_1275_dwlock_2":[21,0,21,32176,35810]}, + "hooks": [1,140,6242,294,294,501,589,31,32,135,6,24,0,7426,388,24,105,103,1,32,0,4,3], + "events": {"atk":328,"deploy":32,"die":32,"dmg":541,"fx":78,"heal":27,"leak":103,"skill":12,"spawn":120,"status":178}, + "fx": {"aoe":8,"beam":24,"burst":4,"displace":25,"dodge":5,"spGain":12}, + "snaps": "c9dff647 505536a6 046d3d99 29e1ce4f 95f692ed cb471e6e 3e929e64 72083a81 77cee0d9 d920f33c d26b1231 10d91924 2bc3222a 3b3d8eb1 a41709a6 a48f0d23 774d80e5 2256086c dbd65fc9 29f0c70c fa23ead3" } } }